Problem
Issue #533 safely removed read locking from uncaptured mutator-private activations, but every private binding write still acquires Environment.binding_lock. Exact schema-next attribution for representative_shape_transition_fanout at 8 lanes / 1,000 jobs accounts for all 72,531 invocation acquires:
- 16,334 reads (16,238 root, 96 captured)
- 56,197 writes
- 0 concurrent-trace acquires
- 56,191 of the writes are uncaptured private-activation writes; only 6 are root writes
Thus private writes are 99.99% of Environment writes and 77.47% of all Environment locking in this workload. The context uses parallel mutators with mid-script collection disabled, so no marker can trace activation tables concurrently, yet the process-global lock policy cannot express that fact.
Required design
Give each Environment an immutable/inherited synchronization capability derived from its owning Context. An uncaptured private activation may elide binding-write locking only when concurrent environment tracing is impossible for that Context. Root, module, captured/shared, standalone concurrent-marker, and parallel mid-script collector paths must remain locked. Closure publication must continue to revoke private access before another mutator can observe the environment.
This must be a general ownership/capability rule, not a workload check or global flag workaround.
Acceptance
- Unit tests prove private write elision and capture revocation with exact lock attribution.
- TSan covers shared closure mutation and concurrent marker/parallel collector configurations.
threadfuzzstays deterministic and race-free.- Full unit suite passes without leaks.
- Exact affected test262 subtree comparisons show no regressions.
- Re-measure #531 1/2/4/8 scaling and report raw checksums/medians honestly; keep #531 open unless its acceptance is met.