Commit Graph

1 Commits

Author SHA1 Message Date
Drew T e0eaa16741 feat(phase-30 S45p7): Stage 1 complete — shared-state RW lock + 15 more banks (wave-3 revived)
STAGE 1 of docs/concurrency-design.md, landed and negative-control proven.

tools/shared_lock.py (NEW) — one reader/writer flock over the FLEET-SHARED state
(src/shared/*, config/overlays.mk, config/dedup.us.yaml, the overlay .c files
propagation rewrites). Per-binary resources keep gate_stage's existing per-binary flock.
  - gate_stage takes it SHARED when the gate writes no shared state, EXCLUSIVE when it
    does (propagate, or the arity pre-pass enabled) -- so distinct-binary gates still run
    concurrently but can never overlap a writer.
  - dedup_propagate and fix_arity_callers --apply take it EXCLUSIVE.
  - NESTING-AWARE: gate_stage SPAWNS both writers, so a naive child lock would deadlock
    against the parent. The holder exports BFM_SHARED_LOCK_HELD and children inherit.

NEGATIVE CONTROLS (all pass):
  NC1 a held SHARED lock refuses a non-blocking exclusive writer, loudly, naming the lock
  NC2 parent-holds/child-inherits does NOT deadlock (the real risk in this design)
  NC3 two readers acquire concurrently (0.00s) -- phase-B parallelism preserved

bulk_harvest docstring CORRECTED: its "propagation is the ONLY writer of the shared
engine_core.h" claim was FALSE as written and had been asserted for phases (F1 -- the
arity pre-pass writes it from inside every worker). Now states what is actually true,
under which two conditions, plus the one-line assertion that detects a violation.

BANKS: wave-3's drafts re-gated on a CLEAN tree -> 15 of 20 banked. The same drafts
previously reported 0 banked / 20 near -- that verdict was 100% an artifact of the
broken tree, which is why they were held as UNJUDGED rather than accepted as failures.
check-all 213 passed / 0 failed. F1 bracketing assertion CLEAN.

Session total banked: 44 functions + func_8015C030 propagated x7.
2026-08-07 18:57:10 -06:00