Files
foxhunt/crates
jgrusewski 22f30fe37f fix: atomicExch for seg_tree leaf writes prevents duplicate-index race
PER samples with replacement, so a batch can contain duplicate indices.
With non-atomic leaf writes, two threads processing the same index both
read the same old_pa, but only one write survives — internal nodes get
double the delta while the leaf changed once, permanently corrupting
the tree sum.

atomicExch returns the exact replaced value so each thread propagates
the correct delta regardless of concurrent duplicate writes.

Also fix readback_pinned layout doc: slot 9 is used for diversity loss.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 12:18:40 +02:00
..