- Treat the existing Round 26 candidate at
docs/arena_battles/round_26/sovereign-mpmc-void-protocol/MpmcPipeline.csas the baseline, not as something to replace speculatively. - The current repo already shows a passing AMAL result of
3.316nsindocs/battle_v26_results.md, and a direct local spot-check measured3.543ns; both are under the mission cap. - The AMAL harness is narrower than the brief: it measures a same-thread
TrySend(0)+TryReceive(0)loop frombenchmarks/StandaloneBench_V25.template.txt, so the implementation plan must preserve that hot-path win and add a blocking parallel stress proof for real MPMC behavior. - No
src/files are in scope for this mission.
- Keep public class name:
MpmcPipeline - Keep constructor:
public MpmcPipeline(int laneCount, int laneCapacity) - Keep methods:
public bool TrySend(int laneId, double item)public bool TryReceive(int laneId, out double item)
- Add no new public types or public members.
- Keep the deliverable as a single C# implementation file. Any supporting validation code lives outside the submission file.
- Edit
docs/arena_battles/round_26/sovereign-mpmc-void-protocol/MpmcPipeline.cs - Mirror the final submission to
C:\tmp\arena_round_26\sub_01\MpmcPipeline.cs - Reuse
scripts/amal_harness_v26.pyas-is unless it is actually broken - Add a separate stress validator at
scripts/round26_stress_harness.py - Write stress outputs to:
docs/battle_v26_stress.jsondocs/battle_v26_stress.md
- The implementation remains sharded-lane MPMC: one writer per lane, one home consumer per lane, plus cross-lane stealing.
- "MPMC" is achieved at the system level by many sharded lanes, not by allowing multiple concurrent producers on the same
laneId. - Same-lane multi-producer or same-lane multi-home-consumer use is explicitly out of scope and will not be validated.
TrySendstays lane-local and must remain free oflock,Monitor, and hot-pathInterlocked.- Owned
TryReceivealso stays free ofInterlockedon the normal local path. - Slot correctness continues to come only from
Stamp+Shadowvalidation. HintXorremains advisory only. It may be stale and must never be used as a correctness proof.
DrainOwner == OwnerToken(laneId)means the home consumer exclusively owns drain rights for that lane.DrainOwner == 0means the lane is parked and can be claimed.DrainOwner == other tokenmeans a thief temporarily owns the lane.- Only the current lease holder may advance
ReadSeqPublished. - Every temporary steal lease must be released in
finally. - Parking is allowed only after repeated empty local misses.
- Reacquire is allowed only from
0 -> OwnerToken(laneId)and only if unread data is present. - Steal is allowed only from
0 -> thiefToken; advisory quick-rejects may skip a lane, but cannot prove it empty.
- Preserve the current structure and hot path first.
- If needed, tune only
ParkThreshold,StealBurst, and victim scan order. - If stress shows scan churn or starvation without correctness bugs, add a private advisory skip structure only:
- preferred form: a private activity bitmask or clustered victim cursor
- update it with volatile store/load patterns only
- do not use it as a correctness source
- Escalate to deeper redesign only if stress proves a correctness or liveness failure that cannot be repaired inside the current lease model.
- Do not add global locks,
Monitor, managed queues, or hot-path CAS loops.
- Freeze the current Round 26 file as the working baseline and diff all changes against it.
- Keep the unmanaged arena, padded structs, XOR-shadow slot validation, and parked-lane steal lease pattern intact unless a stress failure maps to a specific invariant break.
- Make only local internal edits inside the single submission file. No harness-driven API changes.
- Mirror the final C# file to the temp submission path after the implementation is complete.
- Run the existing AMAL harness for the official gate result.
- Run the new stress harness and record machine-readable results plus a markdown summary.
- Perform the mandatory self-audit before handoff:
- architect-style
/loop-criticreview - forensics check for
lock(stateLock)/lock(/Monitor - ASCII scan
- dry-run sanity review of lease transitions and slot validation order
- architect-style
- Use the existing Round 26 harness.
- Final acceptance:
PASS,0 B, and< 5.0nsindocs/battle_v26_results.md. - Iteration guard: if a direct local
dotnet run --project benchmarks/SpscRing.Benchmarks.csproj -c Releasespot-check rises above4.0ns, stop tuning and recover the fast path before running the official harness.
laneCount = min(32, max(4, Environment.ProcessorCount))laneCapacity = 256- one producer thread per lane
- one home consumer thread per lane
100_000items per producer- payload encoding:
laneId * 1_000_000d + sequence - pass criteria:
- zero lost items
- zero duplicates
- zero phantom receives
- zero exceptions
- final received count equals final produced count
- all lanes drain to empty
- same lane count
- only a small subset of producers actively publish at first, then all producers resume
- consumers remain active throughout
- pass criteria:
- parked lanes can be stolen
- home consumers can reacquire parked lanes when new data appears
- no stuck non-empty lanes at end
- no permanent starvation after producers resume
laneCapacity = 4- same producer/consumer topology
20_000items per producer- pass criteria:
TrySendmay fail transiently when full- no item loss after retries
- all work eventually drains
- no exceptions or dead progress loops
- many idle lanes, one or two hot lanes
- consumers scan across mostly empty topology
- pass criteria:
- no duplicate steals
- no orphaned work on hot lanes
- acceptable forward progress without lease corruption
round26_stress_harness.pymust emit JSON with:- scenario name
- lane count
- lane capacity
- producer thread count
- consumer thread count
- produced count
- received count
- duplicate count
- lost count
- exception count
- completion time
- pass/fail
- It must also emit markdown with a flat table plus a short conclusion line.
- If the machine exposes fewer than 32 logical processors, the report must say so explicitly and mark the run as reduced-hardware validation.
- Accepted optimization target:
Gate + stress, not gate-only overfit. - Baseline architecture: keep the current XOR-shadow + parked-lane lease design unless evidence forces change.
- Ordering model: x86/x64 TSO is the intended execution model; do not claim ARM-general correctness.
- String rule: all C# strings remain ASCII-only.
- Memory rule: submission stays unmanaged and zero-allocation on the hot path.
- No
src/edits are part of this mission, sodeploy-sync.ps1is not part of Round 26 execution unless scope changes.