Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K dynamic indexing mitigation: check for out of bounds #65

Open
1 task
FlorianDeconinck opened this issue Oct 4, 2024 · 0 comments
Open
1 task

K dynamic indexing mitigation: check for out of bounds #65

FlorianDeconinck opened this issue Oct 4, 2024 · 0 comments

Comments

@FlorianDeconinck
Copy link
Collaborator

FlorianDeconinck commented Oct 4, 2024

The new absolute K indexation and write offset in K means we can go out of bounds without the system being able to warn about it since extent calculation won't be able to cover those access.

Think about the degenerate case of

index = some_bad_math_that_gives_back_2349082093840
field[0, 0, value] = value

This was an iron rule for GT4Py that we now allow to be broken so we can match patterns seen regularly in physics.

To mitigate the issue, we should introduce on DEBUG a bound check, drop before every K offset write or absolute read call which should error out cleanly.

Tracking in gt4py: GridTools/gt4py#1684

Parent: GEOS-ESM/SMT-Nebulae#36


  • On DEBUG generate a check for bounds before absolute indexation
@FlorianDeconinck FlorianDeconinck changed the title Absolute indexing mitigation: check for out of bounds K indexing mitigation: check for out of bounds Oct 9, 2024
@FlorianDeconinck FlorianDeconinck changed the title K indexing mitigation: check for out of bounds K dynamic indexing mitigation: check for out of bounds Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant