Skip to content

datadeps: NoAliasing arguments no longer share one slot - #792

Open
AnnaLena77 wants to merge 1 commit into
JuliaParallel:masterfrom
AnnaLena77:pr/a5-noaliasing-slots
Open

AnnaLena77 wants to merge 1 commit into
JuliaParallel:masterfrom
AnnaLena77:pr/a5-noaliasing-slots

Conversation

@AnnaLena77

Copy link
Copy Markdown

The Datadeps slot cache (aliased_object!) is keyed by aliasing identity, and every NoAliasing value compares equal, so the second distinct NoAliasing argument of a region was handed the first one's slot: a task received another task's value (no error, wrong data). A NoAliasing value has no aliasing to preserve, so it now gets its own copy instead of going through the cache (4 lines in src/datadeps/aliasing.jl).

Regression test test/mpi/noaliasing_args.jl (included from test/mpi/cpu.jl): a type whose aliasing is NoAliasing, one value per task, two partitions per rank, InOut buffers record which value each task saw. At 2 ranks x 2 threads (MPICH, Julia 1.13) both assertions fail on current master and pass with this change; the whole CPU MPI suite passes with it (1131 / 1134 assertions, both ranks). I could not reproduce it with Distributed workers alone (strings and a custom type with a move method did not trigger it), so the test is an MPI test.

AI disclosure: I prepared this change with the help of Claude (Anthropic) and reviewed it myself.
🤖 Generated with Claude Code

The slot cache (aliased_object!) is keyed by aliasing identity, and every
NoAliasing value is equal, so the second distinct NoAliasing argument of a
region was handed the first one's slot: the task that should have received its
own value received another one's. A NoAliasing value has no aliasing to
preserve, so it now gets its own copy instead of going through the cache.

Regression test (test/mpi/noaliasing_args.jl, added to test/mpi/cpu.jl): a type
whose aliasing is NoAliasing, one value per task, two partitions per rank,
InOut buffers record which value each task saw. On upstream master at 2 ranks x
2 threads (MPICH) both assertions fail; with this change both pass.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant