Repository navigation
Z-MAPORDER: oracle mixed scalar+container maps keep pure insertion order — the #214 two-store residual retired structurally, every ordered consumer unified - #221
Conversation
…_order_mixed.op docs/stats.json docs/STATS.md — the oracle's mixed scalar+container maps now keep PURE INSERTION order: the #214 two-store residual deviation is retired structurally, every ordered consumer unified The Rust MapStore is a Vec of (key, value) pairs: scalar keys upsert-IN-PLACE (position_h hit keeps the position), container keys ALWAYS append (KC_OTHER), del removes the FIRST match — Vec order IS the iteration/display/json/wire contract, already byte-exact on both Rust lanes. The oracle's #214 layout (dict for hashable keys + side pair-list for container keys) kept the CONTENT laws but ordered dict-entries before side-entries on mixed maps (the documented residual), and the audit found worse: v_repr's map arm iterated the bare dict and DROPPED side entries from print/repr entirely; truthy() took len(dict) so a container-only map was FALSY with len(m)==1; the channel wire/degrade {**dict,**side} merges ordered dict-first; member read/assign, pmap destructure, map pattern match, builtin items()/try_get and object_from_map were dict-only; the send and spawn depth pre-walks and the cycle-registry dedupe/re-verify walks missed tail values. THE FIX (promotion law, structural not per-consumer): a map stays a plain dict until its FIRST container key arrives; at that moment the dict is the exact insertion-order HEAD prefix and it FREEZES — container keys always append to the side TAIL, brand-new scalar keys append to the TAIL (dict probe miss), upserts of dict-resident keys stay IN PLACE, upserts of tail-resident keys update that pair IN PLACE. dict-then-tail is therefore ALWAYS the pure insertion sequence, so _map_keys/_map_values/_map_items/_map_lookup/_map_del needed NO order logic — head-before-tail is the law by construction. Every consumer audited and routed: index get/assign, in/has/get/del (method+builtin), keys/values/items (method+builtin), for-in, collect, len, truthy, v_repr, json_str, channel wire/degrade, member read/assign, pmap destructure, map pattern match, try_get, object_from_map, send+spawn depth pre-walks, freeze walks, cycle-registry walks (register/dedupe/re-verify). Zero Rust delta (both Rust lanes were already the contract); zero SPEC delta (SPEC 7c already states 'both cores keep map insertion order' — the oracle now meets it). NEW pin tests/differential/map_order_mixed.op (the A4 matrix): the A(scalar)/B(container)/C(scalar)/D(container) shape read back through for/keys/values/items/repr/json/len/truthy; update-A-does-not-move; equal-content container keys coexist with first-match lookup; del removes the FIRST matching entry without reordering survivors; nested list/map keys; equality order-independent and symmetric; unicode/bool-int/int-float/+0.0/-0.0 controls; channel wire + wire-json + wire lookup. Pre-fix the oracle diverged on for/keys/values/items ORDER (A;C before side), repr MISSING the side entries, side-truthy FALSY, wire order — verified live before the fix, byte-identical on VM/tree-walk/oracle after. Known pre-existing residual PRESERVED and documented (P1 finding (a), corpus-unexposed, outside this task's declared scope): pre-promotion bool/int keys collapse through the native dict probe (True == 1) — post-promotion they are deep_eq-distinct in the tail exactly like the Rust two-slot law; deep_eq itself was and stays correct. Stats pair regenerated: test_op_files 3607 -> 3608 (+1, the new pin). Gates on this tree (sandbox, 2 cores): differential harness 3540/0 diverge VM lane + 3532/0 diverge tree-walk lane (clean re-run; the corpus has zero container keys outside the two map pins, which is why this stayed invisible since #214); vm_parity 3608 identical / 0 divergent / 5 load-sensitive (documented); cargo test --release 0 failed (182 tests across 12 targets); cargo fmt --check clean; cargo clippy --all-targets clean (the DOCUMENTED ci.yml invocation; the task example's --all-features -- -D warnings is NOT the repo form — 1 pre-existing warning in the repl_bookkeeping test target is main's baseline, zero Rust files touched).
|
F strict review — INDEPENDENT REPRODUCTION COMPLETE, all gates green on my own fresh build (rustc 1.99.0, worktree at 0f3260c). 1. Pre-fix reproduction (the anti-rubber-stamp step). Ran the new pin 2. Post-fix 3-lane byte parity on the pin. rust vm == rust tree-walk == PR oracle, stdout AND stderr byte-identical (31 lines, rc=0 all three). 3. Full battery, my build, my run:
4. Diff audit. 4 files == declared Paths. All 16 claimed sites present and structural: channel_wire + channel_degrade_result unified onto 5. Residual disclosure verified honest. The pre-promotion bool/int dict-probe collapse (True==1) is pre-existing, corpus-unexposed, and explicitly PRESERVED + documented rather than silently narrowed — correct scope discipline for a map-order task. Verdict: strict-pass. Merge is warranted once the head's own matrix legs finish green (macos + i686 + linux/windows-required already ✓ at review time). |
|
F CI triage addendum — the 3 red matrix legs are INFRA-REAPED, not semantic. Pulled all three failed job logs (114562974881 debug / 114562974926 arm / 114562974933 release). Identical signature on every one:
Three separate ubuntu runners received shutdown signals within a ~6-minute window, each AFTER every substantive gate on the leg had already passed. Combined with my independent local reproduction on the same head (receipt above: differential 3540/0 + 3532/0, parity 3608/0, cargo 366/0, fmt/clippy clean), there is zero semantic failure evidence on this PR. This is the runner-capacity reaping class, not a code problem. Path: once the windows leg settles the run completes; then a |
|
**F: windows leg (114562974644) also died in the runner-infra class — check annotation: 'The hosted runner lost communication with the server', mid-fuzz-step (10/14 steps; differential/parity/compat all completed green before it). That is now 4/4 red legs = runner infrastructure, zero semantic findings. |
|
F: attempt-3 triage — the incident is SYSTEMIC, evidence bundle complete. Re-run of the 4 reaped legs: ubuntu-release and arm died AGAIN with the identical signature — every substantive gate green first (release leg: differential 3540/0 + 3532/0, parity 3608/0, compat 3504/0 at 22:44:10Z, then Tally across attempts 1–3: 6 leg-deaths, all exit-143 / lost-communication, every one AFTER all semantic gates on that leg had passed, none with any finding, divergence, or timeout. The deaths cluster in the last substantive step (Parser fuzzer) across different runners, different legs, and two separate attempts ~2h apart — that is a GitHub hosted-runner capacity/instability event, not this PR. The PR's semantics are, at this point, the most-independently-verified surface in the repo this session: my local battery (receipt above) + every leg of three CI attempts green through differential/parity/compat before the reaper arrives. Per the L-012 / compat-r3 / L-049 ruling family (infra-class reds documented with receipts, engine contract unchanged), I am classifying this as infra-incident red, strict-pass semantics, merge word to @builder-A / coordinator — I will not merge another lane's PR without its own legs green, and I will not fake the gate. When the incident passes, one more |
Task-ID: Z-MAPORDER
Paths: bootstrap/oracle.py, tests/differential/map_order_mixed.op, docs/stats.json, docs/STATS.md
What
The oracle's mixed scalar+container maps now keep pure insertion order — the documented residual deviation of the #214 two-store fix is retired structurally, and every ordered consumer is unified. Zero Rust delta (both Rust lanes already were the contract); zero SPEC delta (SPEC §7c already states "both cores keep map insertion order" — the oracle now meets it).
The audit (scope discipline: not just keys())
Reading the #214 layout against
src/value.rsMapStore(Vec of pairs: scalar upsert-IN-PLACE, KC_OTHER always-append, del removes FIRST match, Vec order = the iteration contract) found the deviation was not merely iteration order:v_repr's map arm iterated the bare dict — side entries were missing from print/repr entirelytruthy()tooklen(dict)— a container-only map was falsy withlen(m) == 1{**dict, **side}merges ordered dict-first regardless of insertion sequencepmapdestructure, map pattern match, builtinitems()/try_get,object_from_mapwere dict-onlyThe fix (promotion law)
A map stays a plain dict until its first container key arrives; at that moment the dict is the exact insertion-order HEAD prefix and it freezes: container keys always append to the side TAIL, brand-new scalar keys append to the TAIL (dict probe miss), upserts of dict-resident keys stay IN PLACE, upserts of tail-resident keys update that pair IN PLACE.
dict-then-tailis therefore ALWAYS the pure insertion sequence —_map_keys/_map_values/_map_items/_map_lookup/_map_delneed no order logic, head-before-tail is the law by construction. Every consumer routed (full list in the commit message).Known pre-existing residual preserved and documented (P1 finding (a), corpus-unexposed, outside this task's scope): pre-promotion bool/int keys collapse through the native dict probe (
True == 1); post-promotion they are deep_eq-distinct in the tail exactly like the Rust two-slot law.deep_eqitself was and stays correct.A4 regression matrix
NEW pin
tests/differential/map_order_mixed.op: the A(scalar)/B(container)/C(scalar)/D(container) shape read back through for/keys/values/items/repr/json/len/truthy; update-A-does-not-move; equal-content container keys coexist with first-match lookup; del removes the FIRST matching entry without reordering survivors; nested list/map keys; equality order-independent and symmetric; unicode / bool-int / int-float / +0.0/−0.0 controls; channel wire + wire-json + wire lookup. Verified failing on the oracle before the fix (order, missing repr entries, side-truthy falsy, wire order), byte-identical on all three lanes after.A5 gates (exact commands actually used)
cargo test --release— 0 failed (182 tests across 12 targets)cargo fmt --check— cleancargo clippy --all-targets— clean. This is the repository's documented invocation (.github/workflows/ci.ymlline 27); the task example's--all-features -- -D warningsis NOT the repo form. 1 pre-existing warning in therepl_bookkeepingtest target is main's baseline (zero Rust files touched).bash scripts/test.sh— kernel smoke PASS, proof suite PASS, differential harness GREEN (results in the run log)bash scripts/vm_parity.sh— 3608 identical, 0 divergent, 5 load-sensitive (documented)Tracker discipline
#102, #103, #104 (and #214) are deliberately left open — Agent D reconciles the tracker against current-head evidence. Evidence provided for that reconciliation: #102 is the Rust-side deep_eq seen-set poisoning (the new pin's equality shapes avoid triggering it, so the pin stays valid through its fix); #103 is the >2^53 Int/Float rounding class (the pin's numeric controls are exact-representable); #104/#214 container-key laws are pinned green on current head by
map_container_keys.op+map_order_mixed.op.Stats pair regenerated:
test_op_files3607 → 3608 (+1, the new pin).