interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / evidence / DUAL / 3a-jspace-tap / receipt.md

274 lines · 14906 bytes Raw Blame History Source

DUAL-3a receipt: read-only observation tap at decision site jspace.residency

Lane: DUAL-3a (ADR 0031 section 7.3 and section 8 row DUAL-3; DUAL_CURRENT_STATE.md slice 5). Repository: aien-dev/omega. Branch dual/3a-jspace-tap. Host only (CPU); no GPU, no chip test touched.

FieldValue
Base (GitHub main at clone, re-fetched)cb7cc216147664549484fcca8e8ceadbd6f6cdbf
Candidate, implementation commit9f78d35 (parent cb7cc216)
Candidate, finalthe commit carrying this receipt (PR head)
Working tree at each runclean, git status --short empty (section 6)
Compilergcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
Flags, tap suite-std=gnu11 -Wall -Wextra -Werror -D_GNU_SOURCE -O2 -Isrc -pthread; ASan/UBSan leg adds -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all
Flags, existing suiterepository CFLAGS (-std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 ...) with PHYSICS_DIR=$HOME/workspace/physics
VerdictDUAL-3a tap IMPLEMENTED; DUAL_ADVISORY_SCHEDULER NOT CLAIMED

1. What changed

src/runtime/rx_jspace.h, src/runtime/rx_jspace.c only (production). Decision changes: none.

2. Record schema (version 1)

Kind byte 0xD3, version 1, digest domain omega.dual.site.jspace_residency.v1, decision-site id jspace.residency. Canonical encoding is 302 bytes, fixed little-endian layout, kind and version first; digest = SHA-256(domain || 0x00 || canonical bytes).

OffsetBytesField
01kind 0xD3
11version 1
21site id length (16)
316site id jspace.residency
198seq (u64, monotonically increasing per space)
278pressure (f64 bits; the value the chooser used: 1e9 or 1e3)
351pressure case: 1 = CAPACITY (total residency over budget, stays hard), 2 = SOFT (hot arena over half the budget)
361allow_move
371chosen action (JsAction; 8 = keep)
381number of priced alternatives
394 x 34alternatives in chooser order MOVE, COMPRESS, SPILL, EVICT: action u8, status u8 (0 inadmissible, 1 built but frees nothing, 2 priced), now_ns f64, later_ns f64, freed_bytes f64, score f64
1758best score (cheapest priced; 0 when none)
1838keep threshold = pressure x retain_ns_per_byte
1918expected reads
1994realization slot (JsRealId.slot)
2038realization generation (JsRealId.gen)
2113realization type, placement, recipe
21416unit bytes, held (resident) bytes
2308holders u32, refs u32
2388last_use (J-Space logical clock)
24632semantic state id
27824budget bytes, resident bytes, hot-arena bytes at the instant of the decision

3. R16 loop-inventory rule and how it is met

Rule (spec/r16-orchestrator-retirement.md section 4; scanner tools/r16_loop_inventory.c, --patterns): every while(/for(/do{ in a tracked .c/.h/.rs file is a site when it is unbounded (while(1), for(;;), ...) or its condition/body contains a wait word (`sleep poll recv heartbeat tick dispatch schedule orchestrate turn pulse yield epoll`), or when a line names run_until_complete, max_steps, max_turns. New code under src/runtime/ must add no site.

Check: ./tools/r16_loop_inventory.sh before: sites=387 unclassified=60 (pre-existing drift in other repositories, unrelated), zero sites in src/runtime/rx_jspace.c. After (new test files tracked): `sites=387 unclassified=60, zero sites in src/runtime/rx_jspace.c`, tests/runtime/rx_dual_jspace_tap.c, tests/runtime/rx_dual_jspace_tap_bench.c. Every new loop is bounded and contains no wait word; the tap polls nothing, sleeps nowhere and sequences nothing.

4. Pre-registered benchmark thresholds

Workload (tests/runtime/rx_dual_jspace_tap_bench.c, public API only, in 9f78d35): fan-out 256 branches over a depth-4 root, 4096-byte units, fixed JsCosts, 40 rounds per trial, each round two timed js_forge_enforce calls (SOFT case at budget 3/2 of residency, CAPACITY case at budget 1/2), 7 trials per leg, legs interleaved, medians reported. Three legs: base commit rx_jspace.c (observer absent from the code), candidate with observer NULL, candidate with a recording observer that encodes every record and folds its digest.

A miss is recorded as FAIL in section 6 and not re-run silently.

Pre-registration caveat (honest record). This section was written to this file and staged before the benchmark ran, and the implementation commit 9f78d35 was meant to carry it. It did not: evidence/DUAL/ was gone from the working tree and the index by the time that commit was made (cause UNKNOWN; crumb compile was tested afterwards and does not remove it; no Makefile rule touches evidence/). The thresholds were therefore written before the run but first committed after it, in the commit carrying this receipt. The workload and the bench program were committed before the run in 9f78d35; the threshold numbers rest on this statement. A reader who wants a stronger pre-registration should treat T1-T3 as declared-then-run, not committed-then-run.

5. Tests and commands

5.1 Existing suite covering rx_jspace.c

make test-jspace-prod PHYSICS_DIR=$HOME/workspace/physics

Other targets that compile rx_jspace.c:

5.2 New targets (mk/dual_jspace_tap.mk, not part of all or test)

make test-dual-3a = purity + hygiene + parity (plain and ASan/UBSan) + hostile.

Parity suite tests/runtime/rx_dual_jspace_tap.c (includes rx_jspace.c as one translation unit so the reference oracle can call the static cost helpers). Per scenario three legs: silent, observer A, observer B. Asserted: identical js_forge_enforce return codes, identical JsPolicyReport, identical JsStats, identical final space digest (every branch, unit, placement, extent, content check, then full content digests); A and B record streams byte-identical; records == considered; seq 1..n; 302 bytes each; digest recomputed equal; chosen == chooser rule over the record's own alternatives; chosen == the placement transition that realization (slot, generation) underwent in the silent run (the failed last decision of an error-terminated round excepted, and asserted as such); pressure value and case consistent with the recorded budget and residency.

What "identical sequence of chosen actions" means here: the silent run exposes no per-decision sequence (that is the point of the tap), so sequence identity is proven per realization against the silent run (every record's chosen action equals what the silent run did to that very realization, keyed by slot and generation) and as a byte-identical record stream between the two observer legs.

Scenarios: under-budget (0 records), soft-hot-arena (1e3), over-total-capacity (1e9, then SOFT in the same call once total residency is back under budget), ties (COMPRESS == EVICT exactly, first built wins), exactly-at-budget, one-byte-below, one-byte-above, spill-exhaustion (max_spill_bytes = 2 units, rc JS_ERR_FULL (-2) in both legs), evict-drain (budget 0), fanout-500 (and 32 in the others), rep-null, record-tamper (observer writes into the const record: decisions unchanged). Pure extraction: 1752 decisions over 3 cost sets x 4 pressures x 2 allow_move on mixed placements, choose() == verbatim pre-tap body, 0 mismatches; js_forge_choose agrees as well.

Result: DUAL_3A_JSPACE_TAP_PARITY=PASS (failures=0) in the plain and the ASan/UBSan build (no leak, no UB report).

5.3 Negative control (REQUIRED)

make test-dual-jspace-tap-hostile builds the same suite with -DDUAL_TAP_HOSTILE_TEST: the leg-A observer casts its ctx to the space and sets costs.retain_ns_per_byte = 0 on its third record, so the chooser keeps everything afterwards. Output (abridged):

DUAL-3a jspace.residency tap: parity [HOSTILE NEGATIVE CONTROL: the observer mutates the space; this run must FAIL]
  FAIL: soft: a record chose something other than MOVE
  FAIL: soft-hot-arena round 0: JsPolicyReport differs with observer
  FAIL: soft-hot-arena round 1: JsPolicyReport differs with observer
  FAIL: soft-hot-arena: JsStats differ with observer (resident silent 151552 A 151552 B 151552)
  FAIL: soft-hot-arena: final space digest differs with observer
  ... (2035 FAIL lines in all, across every scenario, including per-realization
       "observer saw keep, silent run did move on slot N" lines)
DUAL_3A_JSPACE_TAP_PARITY=FAIL (failures=2035)
test-dual-jspace-tap-hostile: hostile observer detected (parity suite failed as required)

The normal build has no such seam: grep -rn DUAL_TAP_HOSTILE src/ finds nothing (make dual-jspace-tap-hygiene). An earlier hostile variant that raised the retain price a million-fold was found ineffective (every alternative was already far below the keep threshold, so no decision moved and only 1 assertion fired); it was replaced by the retain = 0 variant before the implementation commit. Recorded so the negative control is known to be a real one.

5.4 Purity

make dual-jspace-tap-purity: nm -u on rx_jspace.o matches none of aienos_cap_, rx_gen_, aegis. (The tap is inside rx_jspace.c; the object was also clean before the change.)

6. Run log (in order; nothing edited after the fact)

6.1 Implementation commit

9f78d35 on dual/3a-jspace-tap (parent cb7cc216), working tree clean (git status --short | wc -l = 0) when the benchmark below started. See the section 4 caveat about the receipt file.

6.2 Existing and new suites at 9f78d35

6.3 Benchmark (make bench-dual-jspace-tap, wall clock, medians of 7 trials)

Run 1 (the pre-registered run):

bench[base] observer=NULL  median_wall_ns=2520658 decisions=5410 records=0 bytes=0 (rounds 40, trials 7, fanout 256, unit 4096)
bench[tap] observer=NULL  median_wall_ns=2510132 decisions=5410 records=0 bytes=0 (rounds 40, trials 7, fanout 256, unit 4096)
bench[tap] observer=record median_wall_ns=13637213 decisions=5410 records=5410 bytes=1633820
bench[tap] ratio_on_off=5.433 added_ns_per_record=2056.8 records_equal_decisions=yes

Run 2 (repeated once, for noise; not used to pick a result):

bench[base] observer=NULL  median_wall_ns=2498835 ...
bench[tap] observer=NULL  median_wall_ns=2488819 ...
bench[tap] observer=record median_wall_ns=13628270 decisions=5410 records=5410 bytes=1633820
bench[tap] ratio_on_off=5.476 added_ns_per_record=2059.0 records_equal_decisions=yes
ThresholdMeasured (run 1)Verdict
T1 observer NULL within +-10 % of base2 510 132 / 2 520 658 = -0.42 % (run 2: -0.40 %)PASS
T2 added ns per record <= 10 0002 056.8 ns (run 2: 2 059.0)PASS
T3 records == decisions, bytes == 302 x records5410 == 5410; 1 633 820 == 302 x 5410PASS
ratio on/off (information only, not a bar)5.43x (run 2: 5.48x)reported

Reading: with the observer off the change costs nothing measurable (T1). With a recording observer every decision pays about 2.1 microseconds, almost all of it the plain-C SHA-256 over 302 + 37 bytes; on this synthetic workload a decision itself is about 0.46 microseconds (memcpy-sized moves and frees), so the ratio is large while the absolute cost is small. The ratio is what a DUAL-3b campaign must budget for when it turns the tap on; it is not a production cost today because production has no observer.

7. Limits