Problem
Fresh required TSan CI reports three races in the shared Map iterator cursor witness: concurrent next() calls copy the iterator cursor's three-word CollectionIteratorState in Object.collectionIteratorState while peer threads update index, current, and traversal state in collectionCursorIterNext.
The semantic test happens to finish successfully, but these are engine-state races. A multiword cursor snapshot can be torn even when individual word reads/writes appear valid, violating the repository's no-GIL synchronization contract.
Required implementation
- Give each published collection iterator cursor an explicit synchronization ruling.
- Make state inspection and advancement one atomic logical transaction without serializing unrelated Map/Set instances or the underlying collection's independent readers.
- Preserve iterator ordering, deletion/insertion semantics, exhausted-state idempotence, and GC tracing/relocation of the cursor's managed edges.
- Do not suppress TSan, make the fields independently atomic, restore the context GIL, or weaken the shared-cursor witness.
Acceptance
parallel_js: Map iterator cursor advances atomically without GILpasses with zero TSan reports.- Focused tests cover concurrent
next(), exhaustion, mutation during iteration, Map keys/values/entries, Set values/entries, and GC while a cursor is shared. - Normal, TSan, no-GIL, and Test262 Map/Set iterator coverage remain green.
Parent: #478
Related CI: tsan-parallel-js