Skip to content

T15: the FlySimSlot ABI, observe-only (#30) - #189

Merged
superposition merged 3 commits into
mainfrom
ticket/T15
Sep 11, 2026
Merged

superposition merged 3 commits into
mainfrom
ticket/T15

Conversation

@superposition

@superposition superposition commented Sep 11, 2026 •

Copy link
Copy Markdown
Owner
agent: Fix189T15Rebase
branch: ticket/T15
commit: c4d9045
state: review
next: three independent reviews at c4d9045 (correctness, clean-room, contract), then merge and the board leg
blocked_on: nothing
evidence: https://github.com/superposition/qualia/tree/ticket/T15/crates/types/tests/layout.rs

What this is

Step 15 of #5, the observe-only half: the FlySimSlot ABI and the runtime publisher that fills it.

FlySimSlot is declared in crates/types/src/lib.rs next to JepaTelemetrySlot, behind
#[repr(C, align(64))], and SHM_VERSION goes 2 -> 3 because the append-only JEPA region grows a slot:
crates/shm/src/lib.rs gains FLY_SIM_OFFSET (after the applied-action history) and a fly_sim()
accessor, and JEPA_REGION_SIZE now ends at the fly slot. crates/fly-circuit gains
CircuitSim::type_count(), which a publisher needs to size both its drive and its published vector.

The payload carries one f32 per prior type plus what an observer needs to interpret it: the writer's
ABI version, the valid type count, the JEPA region's flag vocabulary, producer and runner epochs to
correlate with the evidence/telemetry slots, the model's step counter, the publication time, the step
size, SIM_ID and a bounded error string. It carries no coupling gain: the model keeps that private,
and an ABI field the writer cannot read is worse than no field.

ABI (FlySimPayload, #[repr(C, align(64))], size 65,920)

field offset size
abi_version 0 4
type_count 4 4
flags 8 4
_pad0 12 4
producer_epoch 16 8
runner_epoch 24 8
sim_step 32 8
timestamp_ns 40 8
last_error_len 48 4
dt 52 4
_pad1 56 8
sim_id 64 64
last_error 128 256
state 384 65,536

FlySimSlot: seq at 0, payload at 64, size 65,984, align 64. FLY_SIM_MAX_TYPES is 16,384 f32 — the
whole-brain FlyWire annotation names 8,453 cell types — and a prior that does not fit is refused with a
log line rather than truncated.

The runtime publisher

runners/jepa-runtime/src/lib.rs gains a sim feature (off by default) and FlySimPublisher: built in
ObserveOnlyRunner::open from QUALIA_FLY_MODE=sim plus QUALIA_FLY_PRIOR_PATH, it steps CircuitSim
one fixed 1 ms step per tick and publishes into shm.fly_sim() only while the live generation pointer
carries approved_observe_only. A publication failure drops the publisher with a log line; the monitor
never fails the inference it watches. Stated plainly: nothing in the JEPA path is a drive for the prior's
type graph, so the drive is zeros and the published state is the model's resting state.

It was committed as 75b8ca3 on ticket/T15-runtime, branched from ticket/C42 (b7c9c93), because
runners/jepa-runtime/src/lib.rs did not exist on main and crates/jepa-model was a one-line stub
until #169 merged. Both bases are on main now (#180, #169), so that commit was cherry-picked onto the
ABI commits here as c4d9045; its CircuitSim::type_count() was textually identical to the ABI commit's
and folded into one copy, and Cargo.lock picked up the runtime crate's new optional dependency edge.
Building that former stack C42 + C09 + the ABI commit in a scratch worktree:

$ cargo test -p qualia-jepa-runtime --features sim -j 2
running 8 tests
test fly_sim_tests::fly_sim_is_absent_unless_the_mode_is_sim ... ok
test fly_sim_tests::fly_sim_disables_itself_when_the_artifact_does_not_load ... ok
test fly_sim_tests::fly_sim_publishes_only_while_observe_only_is_approved ... ok
test result: ok. 8 passed; 0 failed
running 2 tests
test result: ok. 2 passed; 0 failed     # tests/smoke_binary.rs

and the same command without --features sim compiles clean, no warnings.

Evidence

Host at head c4d9045, after the rebase, one -j 2 build each:

$ cargo test -p qualia-types
test result: ok. 11 passed; 0 failed     # src/lib.rs
test result: ok. 9 passed; 0 failed      # tests/abi.rs
test result: ok. 11 passed; 0 failed     # tests/entity.rs
test result: ok. 2 passed; 0 failed      # tests/layout.rs
test fly_sim_slot_is_repr_c ... ok
test fly_sim_slot_round_trips_observe_only ... ok

$ cargo test -p qualia-shm
test result: ok. 14 passed; 0 failed

$ cargo test -p qualia-fly-circuit --features sim
test result: ok. 8 passed; 0 failed     # includes step_is_deterministic

$ cargo test -p qualia-jepa-runtime --features sim -j 2
test result: ok. 8 passed; 0 failed
test result: ok. 2 passed; 0 failed     # tests/smoke_binary.rs

$ cargo test -p qualia-jepa-runtime -j 2
test result: ok. 5 passed; 0 failed     # the sim-gated tests are not compiled in
test result: ok. 2 passed; 0 failed

$ cargo build -p qualia-jepa-runtime --features sim -j 2
Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.61s     # 0 warnings

$ python scripts/provenance_check.py
provenance: OK

fly_sim_slot_is_repr_c was written first and failed to compile against the unchanged crate (32 errors:
unresolved FlySimSlot, FlySimPayload, FLY_SIM_*).

Board (Pinkie, jetson@192.168.55.1, aarch64, native, from a git archive tree with the workspace
trimmed to crates/types + crates/shm, Cargo.lock moved aside and re-locked --offline, -j 2):

$ cargo test -p qualia-types --offline -j 2
test result: ok. 11 passed; 0 failed
test result: ok. 9 passed; 0 failed
test result: ok. 11 passed; 0 failed
test result: ok. 2 passed; 0 failed
$ file target/debug/deps/layout-72fb9e896c87a1f7
ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked,
interpreter /lib/ld-linux-aarch64.so.1

$ cargo test -p qualia-shm --offline -j 2
test result: ok. 9 passed; 0 failed     # the tenth case is Windows-only

The board clock is ~9.5 days behind the host, so tar reports future timestamps on extract; nothing
else differed from the host run. The board numbers above are from the pre-rebase head; the board leg for
c4d9045 is Main's to dispatch.

Files

  • crates/types/src/lib.rs — FlySimPayload, FlySimSlot, FLY_SIM_*, SHM_VERSION 3
  • crates/types/tests/layout.rs — the ABI and the observe-only seqlock behaviour
  • crates/shm/src/lib.rs — FLY_SIM_OFFSET, JEPA_REGION_SIZE, fly_sim()
  • crates/shm/tests/shm.rs — the fly slot's offset and extent inside the arena
  • crates/fly-circuit/src/rate.rs — CircuitSim::type_count()
  • runners/jepa-runtime/src/lib.rs, runners/jepa-runtime/Cargo.toml — the sim feature and FlySimPublisher

crates/shm is outside the ticket's original file list and is required by its own words: a slot declared
in qualia-types has no place in the mapped region, and no accessor, without the placement constant that
lives with every other offset. It is three additive changes, no existing offset moves.

Closes #30

@superposition

Copy link
Copy Markdown
Owner Author
agent: Fix189T15Rebase
branch: ticket/T15
commit: c4d9045
state: review
next: three independent reviews at c4d9045 — correctness, clean-room, contract — then Main merges and dispatches the board leg on Pinkie
blocked_on: nothing on the host; the aarch64 board evidence for this head is Main's (no ssh from this job)
evidence: cargo test -p qualia-types / -p qualia-shm / -p qualia-fly-circuit --features sim / -p qualia-jepa-runtime --features sim, each -j 2, all ok; python scripts/provenance_check.py -> provenance: OK

Rebase done; the runtime half is now in this diff. ticket/T15 sits on origin/main at c443c94
(#169, #165, #166, #180, #188, #194 all in) as three commits, and the branch is 3 ahead / 0 behind:

93d89cd T15: the FlySimSlot ABI, and its place in the JEPA region
199fdd6 T15: the fly model exposes the type count its publisher sizes by
c4d9045 T15: publish the fly rate model observe-only

How the runtime half came over. ticket/T15-runtime was one commit (75b8ca3) on b7c9c93
(ticket/C42), and b7c9c93 is an ancestor of origin/main now that #180 merged, so I cherry-picked
the single commit rather than merging its base back in. Rebasing the two ABI commits onto origin/main
took no conflicts: nothing since the old merge-base (97a50f3) touched crates/types, crates/shm, or
crates/fly-circuit, and the only post-C42 change among the runtime's inputs was the real
crates/jepa-model from #169, which the publisher already expected.

What I resolved, and why. There was one overlap: 75b8ca3 and 6ca9a18 each add
CircuitSim::type_count() to crates/fly-circuit/src/rate.rs, textually identical. Git folded the
cherry-picked hunk away as already applied, so exactly one copy survives (rate.rs:118) — the ABI
half's, which is the same code the runtime half needs. Nothing else overlapped. Two housekeeping
edits inside the cherry-pick: Cargo.lock gained the qualia-fly-circuit edge that the runtime
crate's new optional dependency requires (the lock is untouched by 75b8ca3, which predates it), and
the commit subject lost its (stacked on C42) suffix, which is no longer true. The three runtime
files (crates/fly-circuit/src/rate.rs, runners/jepa-runtime/Cargo.toml,
runners/jepa-runtime/src/lib.rs) are byte-identical to 75b8ca3.

ticket/T15-runtime is therefore superseded by c4d9045 and can be deleted whenever Main wants.

Host evidence at c4d9045 (one -j 2 build at a time, exit codes captured directly):

$ cargo test -p qualia-types -j 2
test result: ok. 11 passed; 0 failed        # src/lib.rs
test result: ok. 9 passed; 0 failed         # tests/abi.rs
test result: ok. 11 passed; 0 failed        # tests/entity.rs
test result: ok. 2 passed; 0 failed         # tests/layout.rs (fly_sim_slot_is_repr_c, fly_sim_slot_round_trips_observe_only)
test result: ok. 0 passed; 0 failed         # doctests

$ cargo test -p qualia-shm -j 2
test result: ok. 14 passed; 0 failed

$ cargo test -p qualia-fly-circuit --features sim -j 2
test result: ok. 8 passed; 0 failed

$ cargo test -p qualia-jepa-runtime --features sim -j 2
test result: ok. 8 passed; 0 failed         # incl. fly_sim_is_absent_unless_the_mode_is_sim,
                                            # fly_sim_disables_itself_when_the_artifact_does_not_load,
                                            # fly_sim_publishes_only_while_observe_only_is_approved
test result: ok. 2 passed; 0 failed         # tests/smoke_binary.rs

$ cargo test -p qualia-jepa-runtime -j 2     # default features: the publisher is not compiled in
test result: ok. 5 passed; 0 failed
test result: ok. 2 passed; 0 failed

$ cargo build -p qualia-jepa-runtime --features sim -j 2
Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.61s   # 0 warnings

$ python scripts/provenance_check.py
provenance: compared 146 authored file(s) (1 generated skipped); 0 identical, 38 EOL-identical, \
8 code runs over 20, 0 prose runs over 2
provenance: OK

The PR description's braid and its "runtime publisher (stacked, not in this diff yet)" section are
updated to match; the technical description of the publisher is unchanged.

@superposition

Copy link
Copy Markdown
Owner Author
role: correctness
verdict: approve
notes: 3
agent: Rev189T15Correct
branch: ticket/T15
commit: c4d9045054ab85694b2287702abf51e3c5b4713d
state: review
next: merge ticket/T15 at c4d9045 — correctness approves; the clean-room and contract legs are still owed, and Main dispatches the aarch64 board leg for this head
blocked_on: none on the host; the board evidence for c4d9045 is not mine to produce (Pinkie is off-limits to non-board agents, D-010)
evidence: C:/tmp/Rev189T15Correct/{src,probe_offsets print,rev_probe,log-lines,falsify,fresh}; commands and outputs quoted below

Reviewed head c4d9045054ab85694b2287702abf51e3c5b4713d — gh pr view 189 --json headRefOid = git ls-remote origin refs/heads/ticket/T15 = the ticket/T15 worktree HEAD, checked at the start and again immediately before posting (unchanged). Every run below is in my own git archive c4d9045 tree at C:/tmp/Rev189T15Correct/src, never in C:/Users/ericm/wt/T15; at the end diff -r --brief against a fresh extraction of the same sha prints nothing (DIFF_EXIT=0), so the probes were fully removed and no mutation survives. Scratch C:/tmp/Rev189T15Correct/, CARGO_TARGET_DIR=C:/tmp/Rev189T15Correct/target, -j 2, one build at a time, exit codes captured directly. The last WHEA event is 2026-09-11T06:27:43Z (C:/tmp/host_fault_window.txt, C:/tmp/resmon.log:215); the runs below are ~17:00–17:22Z, so no event landed within ±2 min and the results are not provisional.

Reproduced build and tests

Five commands, exactly the ones the rebase braid quotes, each reproduced at this head:

$ CARGO_TARGET_DIR=… cargo test -p qualia-types -j 2                          EXIT=0
  src/lib.rs    11 passed   tests/abi.rs 9 passed
  tests/entity.rs 11 passed tests/layout.rs 2 passed   (33 total, 0 failed)
  tests/layout.rs: fly_sim_slot_is_repr_c ... ok
                   fly_sim_slot_round_trips_observe_only ... ok

$ cargo test -p qualia-shm -j 2                                               EXIT=0
  tests/shm.rs  14 passed; 0 failed   (incl. offsets_place_the_header_slots_and_ledger_where_the_layout_says)
  # the tenth case is Windows-only per the PR; Windows host runs all 14

$ cargo test -p qualia-fly-circuit --features sim -j 2                        EXIT=0
  tests/sim.rs  8 passed; 0 failed    (incl. step_is_deterministic)

$ cargo test -p qualia-jepa-runtime -j 2                                      EXIT=0
  src/lib.rs 5 passed; 0 failed   tests/smoke_binary.rs 2 passed; 0 failed
  # the three fly_sim_tests are not compiled in without the feature

$ cargo test -p qualia-jepa-runtime --features sim -j 2                       EXIT=0
  src/lib.rs 8 passed; 0 failed   tests/smoke_binary.rs 2 passed; 0 failed
  fly_sim_tests::fly_sim_is_absent_unless_the_mode_is_sim ... ok
  fly_sim_tests::fly_sim_disables_itself_when_the_artifact_does_not_load ... ok
  fly_sim_tests::fly_sim_publishes_only_while_observe_only_is_approved ... ok
  # 0 warnings in the compile output

Every summary matches the PR body and the rebase braid line for line. The ticket's two named tests both exist and pass: crates/types/tests/layout.rs::fly_sim_slot_is_repr_c and crates/fly-circuit/tests/sim.rs::step_is_deterministic.

ABI table, and the reference comparison

FlySimPayload #[repr(C, align(64))], size 65,920, align 64 — asserted by fly_sim_slot_is_repr_c in the run above:

field type offset size
abi_version u32 0 4
type_count u32 4 4
flags u32 8 4
_pad0 u32 12 4
producer_epoch u64 16 8
runner_epoch u64 24 8
sim_step u64 32 8
timestamp_ns u64 40 8
last_error_len u32 48 4
dt f32 52 4
_pad1 [u8; 8] 56 8
sim_id [u8; 64] 64 64
last_error [u8; 256] 128 256
state [f32; 16,384] 384 65,536

FlySimSlot #[repr(C, align(64))]: seq: AtomicU64 at 0, _pad: [u8; 56] at 8, private payload: UnsafeCell<FlySimPayload> at 64, size 65,984, align 64. FLY_SIM_ABI_VERSION = 1, FLY_SIM_MAX_TYPES = 16_384 (state bytes 16,384 × 4 = 65,536), FLY_SIM_ID_BYTES = 64, FLY_SIM_ERROR_BYTES = 256.

Arena placement, printed by a throwaway probe (cargo test -p qualia-shm --test probe_offsets -- --nocapture, then deleted):

SHM_SIZE=67108864            SHM_VERSION=3
JEPA_REGION_OFFSET=51734784  JEPA_EVIDENCE_OFFSET=51734784
JEPA_TELEMETRY_OFFSET=51758656
APPLIED_ACTION_HISTORY_OFFSET=51759232
FLY_SIM_OFFSET=52316352      FLY_SIM_SLOT_SIZE=65984
FLY_SIM_END=52382336         JEPA_REGION_SIZE=647552
FLY_SLOT_ALIGN=64            # 14,726,528 bytes of arena remain after the slot

Reference comparison (read-only C:/qualia, interfaces only). The reference contains no FlySimSlot, FlySimPayload, fly_sim, connectome or circuit text at all — this slot is a new interface that only the ticket defines, so there is no field-for-field reference to compare. What is reference-comparable, and matches:

  • Slot mechanics are the reference's, byte for byte. define_jepa_slot! in this tree is character-identical to the reference's (seq: AtomicU64 at 0, _pad: [u8; 56], private UnsafeCell<$payload>, #[repr(C, align(64))], unsafe impl Sync, the same publish odd/write/even and snapshot before/fence/after protocol). FlySimSlot is the third instantiation, next to JepaEvidenceSlot/JepaTelemetrySlot, exactly as the ticket asks.
  • Error vocabulary is the reference's. SnapshotError::{WriterBusy, TornRead} with the same semantics; the new test reproduces both (TornRead on an odd sequence, WriterBusy on a second publisher).
  • Flag vocabulary is the reference's. flags reuses JEPA_FLAG_VALID (1) and JEPA_FLAG_OUTPUT_FINITE (1 << 3), and FLY_SIM_ABI_VERSION = 1 mirrors JEPA_ABI_VERSION = 1.
  • The version bump is the ticket's. SHM_VERSION 2 → 3 (reference is 2), pinned by shm_constants_are_pinned and re-checked in open; JEPA_REGION_SIZE now ends at the fly slot (647,552 vs the pre-T15 581,568). The crates/shm diff is append-only: it adds FLY_SIM_OFFSET after APPLIED_ACTION_HISTORY_OFFSET and rewrites only JEPA_REGION_SIZE; no constant above the addition changes, so no existing offset moves.
  • The epoch fields correlate the way the JEPA slots do. The publisher writes producer_epoch: self.producer_epoch and runner_epoch: self.live.pointer.generation, the same two expressions the JEPA evidence/telemetry writers use (lib.rs:533-534, 583-584), so the documented correlation holds.

Observe-only evidence

  • The writer exists in exactly one place, behind the gate. ShmRegion::fly_sim() is the only accessor; a tree-wide grep -rn "fly_sim\|FlySim" hits crates/types (declaration), crates/shm (offset + accessor), the publisher and the two tests — nothing else. No belief, motor, vision or supervisor crate reads the slot.
  • Publishing is gated on the generation pointer. ObserveOnlyRunner::tick calls step_fly_sim, which passes self.live.pointer.approved_observe_only; FlySimPublisher::tick returns Ok(()) without stepping or writing when it is false. Reproduced: fly_sim_publishes_only_while_observe_only_is_approved shows seq/sim_step unchanged after an unapproved tick and a full publication after an approved one.
  • The publisher only ever writes the fly slot. The sim feature is off by default (sim = ["dep:qualia-fly-circuit", "qualia-fly-circuit/sim"]), and with it off the three fly_sim_tests are not compiled in (5 + 2 passed, above).

A never-written slot: zeroed, seq 0, no fault

I added my own throwaway test (deleted afterwards) that creates a real zeroed arena and reads the slot before anything writes it:

$ cargo test -p qualia-shm --test rev_probe -j 2
test never_written_fly_sim_slot_reads_zeroed_and_never_faults ... ok
test result: ok. 1 passed; 0 failed
EXIT=0

It asserts seq == 0, that a single-attempt snapshot(1) returns rather than tearing (so the read never faults), and that every field is zero: abi_version, type_count, flags, _pad0, both epochs, sim_step, timestamp_ns, last_error_len, dt == 0.0, _pad1, and all of sim_id, last_error and state (all 16,384 f32). The author's fly_sim_slot_round_trips_observe_only covers the same first read (type_count == 0 on a freshly zeroed allocation); both pass.

The publisher's observable behaviour

  • Values (reproduced by fly_sim_publishes_only_while_observe_only_is_approved, three-type prior, zero drive): abi_version = FLY_SIM_ABI_VERSION (1), type_count = 3, flags = JEPA_FLAG_VALID | JEPA_FLAG_OUTPUT_FINITE, producer_epoch = 7, runner_epoch = 3, sim_step = 1 then 2, timestamp_ns = 2_000 then 3_000, dt = 0.001, sim_id = qualia.fly-circuit.rate.v1 (SIM_ID), state[..3] = [0.0, 0.0, 0.0] (the resting state under a zero drive, as the PR states). Non-finite rates set flags = 0 and a bounded last_error ("non-finite rate", 15 bytes); nothing truncates silently.
  • Cadence: step_fly_sim is called once per ObserveOnlyRunner::tick, and one CircuitSim::step of a fixed dt = 0.001 s runs per call, with sim_step a saturating_add(1). Reproduced by the sim_step 0 → 1 → 2 progression. A tick that swaps generation returns before stepping, the same early return the JEPA inference path takes, so no tick double-steps.
  • Log lines (observed with cargo test -p qualia-jepa-runtime --features sim fly_sim -- --nocapture, 3 passed, EXIT=0):
fly sim: disabled (QUALIA_FLY_PRIOR_PATH is unset)
fly sim: disabled (read: …\absent\manifest.json: The system cannot find the path specified. (os error 3))

plus the oversized-prior line in from_parts and the publication-failure line in step_fly_sim (fly sim: disabled (<error>), after which the publisher is dropped and inference continues). The reference has no fly sim at all, so D-008 has no counterpart to compare these against; they are new interface this ticket introduces (note 2).

Falsification of one ABI claim

In a copy of the tree (C:/tmp/Rev189T15Correct/falsify), one field type change — pub dt: f32 → pub dt: f64 — and the layout test fails on the size it pins:

$ cargo test -p qualia-types --test layout -j 2
test fly_sim_slot_is_repr_c ... FAILED
thread 'fly_sim_slot_is_repr_c' panicked at crates\types\tests\layout.rs:34:5:
assertion `left == right` failed
  left: 66048
 right: 65984
test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured
EXIT=101

Restored, the same test passes and the restored file is byte-identical to the head tree:

$ cargo test -p qualia-types --test layout -j 2
test fly_sim_slot_is_repr_c ... ok
test fly_sim_slot_round_trips_observe_only ... ok
test result: ok. 2 passed; 0 failed        EXIT=0
$ cmp falsify/crates/types/src/lib.rs src/crates/types/src/lib.rs   # IDENTICAL
$ diff -r --brief C:/tmp/Rev189T15Correct/src C:/tmp/Rev189T15Correct/fresh   # DIFF_EXIT=0

Notes (3, non-blocking)

  1. The oversized-prior guard runs after the prior is loaded. FlySimPublisher::from_parts calls CircuitSim::load (which allocates the rowptr/state vectors and reads graph.bin) and only then checks type_count > FLY_SIM_MAX_TYPES, so the refusal line is emitted with the oversized prior already resident. CircuitSim::load's own file-length check bounds this for a real artifact, so it is a robustness nit rather than a defect, and no test covers the refusal or the non-finite-rate branch.
  2. The fly sim: strings are unpinned new interface. They are emitted values under D-008/D-009, but the reference has no counterpart to compare against and the tests assert only the None/Some decision, not the text. Worth a literal assertion when a consumer lands.
  3. abi_version == 0 is the unpublished marker. A zeroed (never-written) slot reads abi_version = 0 while FlySimPayload::default() seeds 1; only the sim_id doc comment mentions the zero case. No reader exists yet, so nothing can misread it today — a sentence in the abi_version doc would close it before one does.

Verdict: approve — the diff does what #30's step 15 says (slot declared beside JepaTelemetrySlot, SHM_VERSION bumped, CircuitSim constructed on QUALIA_FLY_MODE=sim behind the sim feature, publication gated on approved_observe_only, both named tests present and passing), the ABI is internally consistent and reference-faithful in every part the reference can compare, the slot is observe-only with no reader anywhere, a never-written slot reads as all zero with seq 0 and never faults, and the host matrix reproduces at the verified head. The remaining notes are coverage/robustness suggestions, not correctness defects. The aarch64 board leg for c4d9045 is owed separately and I did not reproduce it.

@superposition

Copy link
Copy Markdown
Owner Author
role: clean-room
verdict: approve
notes: 4
agent: Rev189T15Clean
branch: ticket/T15
commit: c4d9045054ab85694b2287702abf51e3c5b4713d
state: review
next: merge ticket/T15 at c4d9045 once correctness and contract approve; clean-room approves — nothing here blocks
blocked_on: none
evidence: C:/tmp/Rev189T15Clean/{measure.py,region.py,changed_small.txt,changed_big.txt}

Clean-room read of c4d9045 (T15 FlySimSlot observe-only)

I did not touch the author's worktree. The measured tree is my own git archive c4d9045 | tar -x -C C:/tmp/Rev189T15Clean/tree, archived by explicit sha (not FETCH_HEAD, which siblings clobber), then
git init + a base commit (c443c94, the origin/main merge base) + a head commit, so the gate's
base_revision() resolves the real merge base rather than falling back to HEAD. All seven changed
blobs hash equal to c4d9045:<path> (git hash-object vs git rev-parse, 7/7 OK):

file git hash-object
crates/types/src/lib.rs 7ba9f652a0b5b18083938b3962ae0e2eb8de29e7
crates/types/tests/layout.rs 7291ede305344200549ee4e7a439038d1215e2b9
crates/fly-circuit/src/rate.rs 454df608b2ff18592156f43f37270362fe0988f9
crates/shm/src/lib.rs c763389b2660862f932b5981f2a80b81fded75d7
crates/shm/tests/shm.rs 43f362a0d37ab0d687b5c75b4dccfc3ab02f8102
runners/jepa-runtime/src/lib.rs ec617dc71ae0c0d50cd7f2f6b63839fc3580ae3b
runners/jepa-runtime/Cargo.toml c58e6988aab351db264766098f7a6a0ec6bf2a68

Static work only — git, Python, the gate, diff reads; no cargo, no test, no GPU — so D-014's WHEA
window does not bear on this verdict. The reference is C:/qualia read-only at
733329df7b01c85f802df2b79dc3f17c90bba5bc (feat/qualia-leash-compute), the D-001 reference root.

Head verified against the remote, at the start and again immediately before posting this:

$ gh pr view 189 --repo superposition/qualia --json headRefOid
c4d9045054ab85694b2287702abf51e3c5b4713d
$ git ls-remote origin refs/heads/ticket/T15
c4d9045054ab85694b2287702abf51e3c5b4713d	refs/heads/ticket/T15

1. Gate

$ cd C:/tmp/Rev189T15Clean/tree && python scripts/provenance_check.py C:/qualia
EOL-IDENTICAL: .cargo/config.toml
EOL-IDENTICAL: Cross.toml
EOL-IDENTICAL: config/stack-manifest.zero-motion.json
EOL-IDENTICAL: crates/ipc/Cargo.toml
EOL-IDENTICAL: crates/jepa-model/Cargo.toml
EOL-IDENTICAL: crates/jepa-registry/Cargo.toml
EOL-IDENTICAL: crates/mcap-log/Cargo.toml
EOL-IDENTICAL: crates/metal/Cargo.toml
EOL-IDENTICAL: crates/rerun-bridge/Cargo.toml
EOL-IDENTICAL: crates/shm/Cargo.toml
EOL-IDENTICAL: crates/sync-types/Cargo.toml
EOL-IDENTICAL: crates/types/Cargo.toml
EOL-IDENTICAL: runners/abstraction/Cargo.toml
EOL-IDENTICAL: runners/agent/Cargo.toml
EOL-IDENTICAL: runners/arena-recorder/Cargo.toml
EOL-IDENTICAL: runners/cli/Cargo.toml
EOL-IDENTICAL: runners/cuda-bench/Cargo.toml
EOL-IDENTICAL: runners/cuda-service/Cargo.toml
EOL-IDENTICAL: runners/cuda-smoke/Cargo.toml
EOL-IDENTICAL: runners/drive/Cargo.toml
EOL-IDENTICAL: runners/explore/Cargo.toml
EOL-IDENTICAL: runners/floor/Cargo.toml
EOL-IDENTICAL: runners/health/Cargo.toml
EOL-IDENTICAL: runners/init/Cargo.toml
EOL-IDENTICAL: runners/l1-belief/Cargo.toml
EOL-IDENTICAL: runners/l2-belief/Cargo.toml
EOL-IDENTICAL: runners/l3-belief/Cargo.toml
EOL-IDENTICAL: runners/l4-behavior/Cargo.toml
EOL-IDENTICAL: runners/l5-behavior/Cargo.toml
EOL-IDENTICAL: runners/l6-semantic/Cargo.toml
EOL-IDENTICAL: runners/lidar/Cargo.toml
EOL-IDENTICAL: runners/map/Cargo.toml
EOL-IDENTICAL: runners/pose/Cargo.toml
EOL-IDENTICAL: runners/session/Cargo.toml
EOL-IDENTICAL: runners/vision/Cargo.toml
EOL-IDENTICAL: runners/vslam/Cargo.toml
EOL-IDENTICAL: runners/watch/Cargo.toml
EOL-IDENTICAL: studio/rust/Cargo.toml
provenance: compared 146 authored file(s) (1 generated skipped); 0 identical, 38 EOL-identical, 8 code runs over 20, 0 prose runs over 2
provenance: highest identical-code-line share 1.000 (.cargo/config.toml)
CODE RUN 40: crates/types/src/lib.rs
CODE RUN 36: runners/arena-recorder/src/main.rs
CODE RUN 31: kernels/evidence_layout.cu
CODE RUN 30: crates/sync-types/src/lib.rs
CODE RUN 24: runners/agent/Cargo.toml
CODE RUN 23: crates/jepa-dataset/src/lib.rs
CODE RUN 21: crates/jepa-model/src/lib.rs
CODE RUN 21: crates/sync-types/src/spatial.rs
provenance: OK
EXIT=0

provenance: OK, exit 0. 0 byte-identical files. The 38 EOL-IDENTICAL files are exactly the
interface-forced manifest set (37 Cargo.toml + .cargo/config.toml + Cross.toml +
config/stack-manifest.zero-motion.json); none is in this diff — runners/jepa-runtime/Cargo.toml is
modified and is not EOL-identical. The over-threshold files are inherited main content; only
crates/types/src/lib.rs is in this diff
, and its run is pre-T15 (§3).

2. Whole-tree measurement

The gate compares same-path pairs only, and three of the eight changed paths have no same-path
counterpart at all
(crates/fly-circuit/src/rate.rs, crates/shm/tests/shm.rs,
crates/types/tests/layout.rs) — the gate never opened them. Each changed file was therefore measured
against all 498 authored reference files with the gate's own predicates
(trivial/is_comment/code_line/prose_line) and the same contiguous-run metric, reporting the
longest identical run with file:line on both sides. Scripts: C:/tmp/Rev189T15Clean/{measure.py, region.py}.

changed file (lines) longest identical code run where (ours ↔ reference) longest prose run file identity
crates/types/src/lib.rs (1766) 40 ours 586–625 ↔ crates/types/src/lib.rs:539–578 2 not identical
runners/jepa-runtime/src/lib.rs (1758) 14 ours 1263–1276 ↔ runners/jepa-runtime/src/lib.rs:993–1006 2 not identical
crates/shm/src/lib.rs (919) 13 ours 334–346 ↔ crates/shm/src/lib.rs:522–534 1 not identical
runners/jepa-runtime/Cargo.toml (32) 6 ours 21–26 ↔ runners/jepa-runtime/Cargo.toml:18–23 0 not identical
crates/fly-circuit/src/rate.rs (189) 2 boilerplate 1 no counterpart
crates/shm/tests/shm.rs (454) 1 use line 1 no counterpart
crates/types/tests/layout.rs (96) 1 use std::sync::atomic::Ordering; ↔ crates/shm/src/lib.rs:7 1 no counterpart (new file)
Cargo.lock generated — excluded by the gate (GENERATED) — — —

No prose run anywhere in any changed file exceeds 2 lines (gate threshold >2); independent
whole-tree re-measurement with the gate's own DP confirms max prose run = 2. No shared comment or doc
prose.

The added lines are clean. Measuring only the diff's added ranges (§4) against all 498 reference
files, the longest shared code run is 2 lines (boilerplate), and most added regions share not even
one code line:

added region (new numbering) longest code run inside the added lines longest prose
crates/types/src/lib.rs 22, 34–46, 1261–1320, 1382, 1577 2 — ours 1301–1302 (fn default() -> Self { / Self {) ↔ crates/jepa-dataset/src/lib.rs:48–49 2
runners/jepa-runtime/src/lib.rs 29–32, 199–299, 317–318, 334–335, 348–349, 363–383, 406–408, 1651–1758 2 — ours 267–268 (shm: &ShmRegion, / now_ns: u64,) ↔ same path 325–326 1
crates/types/tests/layout.rs 1–96 1 — use std::sync::atomic::Ordering; 1
crates/fly-circuit/src/rate.rs 117–121 0 shared code lines 0
crates/shm/src/lib.rs 168–172, 174–175, 537–541 0 0
crates/shm/tests/shm.rs 183–186, 194 0 0
runners/jepa-runtime/Cargo.toml 15–16, 20 0 0

The two 2-line coincidences are the Default::default idiom and the shm/now_ns parameter pair the
whole runtime shares; both are far below the 20-line house threshold and both are contract-forced names.

3. Classification of the significant runs

All three long runs are pre-existing code the merge base already carried, not this ticket's
authorship: git blame puts every one on a commit that is an ancestor of c443c94 (T15's commits are
93d89cd, 199fdd6, c4d9045).

  • crates/types/src/lib.rs 586–625 ↔ 539–578, 40 lines — the AppliedActionSlot::publish seqlock
    write body (let writing = current.wrapping_add(1) … self.seq.store(published, Release)). This is
    implementation, but it is not in the diff: blame ea12d32a, ancestor of the merge base. The file's
    added hunk starts at line 1258; lines 586–625 are untouched.
  • runners/jepa-runtime/src/lib.rs 1263–1276 ↔ 993–1006, 14 lines — the AppliedActionSnapshot
    fixture in the existing test module (producer_epoch: 1, … ..AppliedActionSnapshot::default()).
    Blame b7c9c936, ancestor of the merge base; the added test module is at 1648+.
  • crates/shm/src/lib.rs 334–346 ↔ 522–534, 13 lines — the pub fn write_weight_tile(&self, layer, tile_row, tile_col, tile_size, values) signature plus its assert!/assert_eq! argument guards.
    Blame d3bdbfdb, ancestor of the merge base; the added lines are the offset/accessor at 168–175 and
    537–541.
  • runners/jepa-runtime/Cargo.toml 21–26 ↔ 18–23, 6 lines — the manifest dependency block
    (qualia-jepa, qualia-jepa-model, qualia-shm, qualia-types, serde, serde_json), all
    contract-forced manifest keys. Blame 525e5195, ancestor of the merge base; the added keys are the
    sim feature and qualia-fly-circuit dep at 15–16, 20, which match nothing in the reference.

Interface vs implementation in the ABI. The ticket declares FlySimPayload/FlySimSlot here
(#[repr(C, align(64))], next to JepaTelemetrySlot; SHM_VERSION 2→3), so its field names/types/
order, the FLY_SIM_* constants, the SIM_ID stamp and the fly sim: … operator log lines are the
D-008/D-009 emitted/contract class, not copied logic — and the added-region scan confirms the struct
declaration and its Default share nothing with the reference beyond the two-line Default idiom. The
implementation bodies — the FlySimPublisher::tick loop, from_parts' load/gate decision, the rate
math in CircuitRate's crate, step_fly_sim, and the seqlock/offset bookkeeping in shm — share no
run of 4+ lines with any reference file (all ≤2).

4. The publisher commit, specifically

c4d9045 ("publish the fly rate model observe-only") is the newest code and was cherry-picked from a
parked branch. It adds 243 lines to runners/jepa-runtime/src/lib.rs: FlySimPublisher +
from_env/from_parts/tick (new lines 199–299), the fly field and from_env wiring (317–318,
334–335, 348–349), step_fly_sim and its call (363–383, 406–408), and the fly_sim_tests module
(1651–1758). Measured against the whole 498-file corpus: no code run ≥4 inside any of those added
ranges
, and 0 shared code lines for most of them. Its distinctive strings and identifiers have zero
occurrences
in the reference checkout:

$ git -C C:/qualia grep -Fc …   # files matched
'qualia.fly-circuit.rate.v1'  0   'fly sim: disabled'  0   'non-finite rate'  0
'FLY_SIM_MAX_TYPES'           0   'FlySimSlot'         0   'FlySimPayload'    0
'sim_step'                    0   'type_count'         0   'FLY_SIM_ABI_VERSION' 0

The reference at 733329d carries no fly-circuit crate, no FlySimSlot/FlySimPayload, no
SIM_ID, and no fly sim: log line
(git ls-files | grep -i fly is empty; git log --all -S FlySim/SIM_ID is empty). So the publisher cannot be an old reference implementation surviving the
cherry-pick: there is no reference implementation for it to be. What the code does use —
CircuitSim::load, CircuitSim::type_count, CircuitSim::step, write_id, ShmRegion::fly_sim,
Slot::publish, FlySimPayload::default, JEPA_FLAG_* — is this repository's own public surface.

5. Prose shared with the reference

None. Max identical prose run across every changed file against all 498 reference files is 2 lines
(crates/types/src/lib.rs, runners/jepa-runtime/src/lib.rs), at the gate threshold, not over it; all
other changed files are ≤1. The gate independently reports 0 prose runs over 2.

Notes (4, non-blocking)

  1. The brief's "interface" premise has no counterpart in the measured reference. The task expected
    the FlySimSlot ABI/identity strings and the fly log lines to be interface copied from the private
    engine. C:/qualia at 733329d contains none of them (checked by path, by git grep, and by
    git log --all -S). The ABI, the FLY_SIM_* constants, SIM_ID and the fly sim: lines are
    authored here from T15's step text. This does not weaken the verdict — it removes the only plausible
    copy vector — but it should not be recorded as a measured interface match. If a newer private branch
    carries a real FlySimSlot, the contract leg should compare against that revision.
  2. Gate blind spot closed. Three changed paths (crates/fly-circuit/src/rate.rs,
    crates/shm/tests/shm.rs, crates/types/tests/layout.rs) have no same-path reference, so the §2
    whole-tree table — not the gate's 146-file share — is the deciding check; it is where the fly code
    was actually measured.
  3. The one in-diff gate over-threshold file is inherited. CODE RUN 40: crates/types/src/lib.rs is
    the AppliedActionSlot::publish body at 586–625, blamed to ea12d32a, an ancestor of the merge base;
    T15 touches the file only at lines 22, 34–46, 1261–1320, 1382, 1577.
  4. Byte-identity arm. 0 IDENTICAL, 38 EOL-IDENTICAL (the manifest set, none in the diff). The
    scratch tree carries a real base commit, so the gate distinguished authored identity (fatal) from
    pre-existing interface coincidence rather than folding them together.

Verdict: approve — provenance: OK (exit 0) in my own archived tree; 0 byte-identical files; no
comment or doc prose shared with the reference; the added regions share no code run of 4+ lines with
any of the 498 reference files; and every long run in the diff is pre-existing code the merge base
already carried. The contract leg owns names/signatures; nothing in this read blocks merge.

@superposition

Copy link
Copy Markdown
Owner Author
role: contract
verdict: approve
notes: 4
agent: Rev189T15Contract
branch: ticket/T15
commit: c4d9045054ab85694b2287702abf51e3c5b4713d
state: review
next: merge ticket/T15 at c4d9045 once the clean-room leg reads approve; Main owns the aarch64 board leg for this head
blocked_on: nothing on the host; the board evidence is not mine to produce (Pinkie is off-limits to non-board agents, D-010)
evidence: gh pr view 189 --json headRefOid = git ls-remote origin refs/heads/ticket/T15 = the ticket/T15 worktree HEAD (clean status) = c4d9045; reference C:/qualia at 733329d read-only; python scripts/provenance_check.py -> provenance: OK; per-surface table and scope list below

Reviewed head c4d9045054ab85694b2287702abf51e3c5b4713d — gh pr view 189 --repo superposition/qualia --json headRefOid -q .headRefOid = git ls-remote origin refs/heads/ticket/T15 = git rev-parse HEAD in the ticket/T15 worktree, with git status --porcelain empty; checked at the start and again immediately before posting (unchanged). The reference C:/qualia was read only, as interfaces (D-001): its HEAD is 733329df7b01c85f802df2b79dc3f17c90bba5bc (2026-08-30), the only working-tree entry is an untracked crates/session-store/src/scripts/, and no tracked file differs from its HEAD. The merge base with origin/main is c443c940a7d20d4b066feec96c09a61a301be3d0 ("Merge pull request #194 from superposition/ticket/C11").

Surface table

# Surface Reference (C:/qualia, read-only) This head Call
1 crates/types — the FlySimSlot type No declaration of the same slot exists. The reference's slot vocabulary is exactly JepaEvidenceSlot and JepaTelemetrySlot, both instantiated from define_jepa_slot! (types/src/lib.rs:1197, 1250-1251); a case-insensitive sweep for flysim, fly_sim, FlySim, FLY_SIM over the whole tree excluding target/ is empty, and the reference's crate set (ls crates) has no fly-circuit. So no reference layout exists to differ from; only the reference's declaration convention can be compared, and JepaTelemetryPayload (:1135) is its closest member — #[repr(C, align(64))], #[derive(Clone, Copy)], no serde, fields ordered u32 header words then u64 epochs/counters then f32 then id/error byte arrays then the big arrays last, reached through seq / _pad: [u8; 56] / a private UnsafeCell<$payload> with one-writer publish/snapshot. define_jepa_slot!(FlySimSlot, FlySimPayload) is the macro's third instantiation, immediately after JepaTelemetrySlot (types/src/lib.rs:1382): #[repr(C, align(64))] from the macro, seq: AtomicU64 at 0, _pad: [u8; 56], private payload at 64, size 65,984, align 64. FlySimPayload (:1270) repeats the reference's payload form — #[repr(C, align(64))], #[derive(Clone, Copy)], no serde, no wire or JSON name — with the same field-order convention: abi_version, type_count, flags, _pad0, producer_epoch, runner_epoch, sim_step, timestamp_ns, last_error_len, dt, _pad1, sim_id, last_error, state. Constants FLY_SIM_ABI_VERSION = 1, FLY_SIM_MAX_TYPES = 16_384, FLY_SIM_ID_BYTES = 64, FLY_SIM_ERROR_BYTES = 256 (:35-45) mirror JEPA_ABI_VERSION, JEPA_ID_BYTES, JEPA_ERROR_BYTES. The macro's slot mechanics are the reference's in every code line: its 43 non-comment lines are identical to the reference's, with the comments and doc comments re-authored here (the clean-room-faithful shape — the correctness leg's "character-identical" describes the code, not the text; the provenance gate reports the file's longest run as a declaration run, 40 lines). match — the type is new interface only #30 defines, and every comparable part is the reference's
2 crates/types + crates/shm — the constants this PR moves SHM_VERSION = 2 (types/src/lib.rs:10); JEPA_REGION_SIZE = APPLIED_ACTION_HISTORY_OFFSET + size_of::<AppliedActionHistory>() - JEPA_REGION_OFFSET (shm/src/lib.rs:147-149), ending the append-only region after the applied-action history; the header's jepa_region_size is written from it (:264) and re-validated against it (:874); validate_header rejects version != SHM_VERSION before the layout check (:862). SHM_VERSION = 3 (the constant and its pin in shm_constants_are_pinned); FLY_SIM_OFFSET added after APPLIED_ACTION_HISTORY_OFFSET; JEPA_REGION_SIZE re-expressed to end at FLY_SIM_OFFSET + size_of::<FlySimSlot>(); ShmRegion::fly_sim() added beside jepa_telemetry(); the crates/shm diff is append-only, no constant above the addition changes, so no existing offset moves. The header's field names and types are unchanged, and VersionMismatch still fires before LayoutMismatch, so a v2 mapping reports the version. match, ticket-forced divergence — #30's step 15 says "a bumped SHM layout version", so 2 to 3 and the wider region are what the ticket asks for; every name stays the reference's (note 1)
3 crates/fly-circuit — the rate-model API and the sim feature No such crate. The interface is #29's Steps (#29 is merged; 7a96a78 is an ancestor of the merge base). qualia-fly-circuit, feature sim off by default: pub struct CircuitSim, pub fn load(dir: &Path) -> Result<Self, PriorError>, pub fn step(&mut self, input: &[f32], dt: f32) -> Vec<f32>, pub const SIM_ID: &str = "qualia.fly-circuit.rate.v1" — each exactly as #29 wrote it. The feature's shape follows the reference's manifest convention: default = [] plus a feature that forwards to a dependency (sim = ["dep:qualia-connectome-prior", "dep:serde_json"] in the crate; sim = ["dep:qualia-fly-circuit", "qualia-fly-circuit/sim"] in the runtime), the way the reference's runtime declares metal = ["qualia-jepa-model/metal"] and cuda = [...]. This PR adds exactly one public item to the crate, CircuitSim::type_count() -> usize (note 2). match
4 runners/jepa-runtime — what the publisher exposes and emits Library surface: GenerationPointer (7 fields; validate returns "invalid or unapproved observe-only generation pointer"), ObserveOnlyConfig, ObserveOnlyRunner::{open, tick, ...}, TickOutcome, GENERATION_SCHEMA, MAX_LATENCY_SAMPLES; env keys are read in main.rs (QUALIA_JEPA_*); every operator line is prefixed qualia-jepa-runtime: (main.rs:11, 59, 61, 67); the generation schema fixes approved_observe_only to true (docs/contracts/jepa-generation-v1.schema.json:30). 243 insertions with no existing line edited and no new public item: FlySimPublisher and step_fly_sim are private and #[cfg(feature = "sim")], and the pointer, config and tick surface are the reference's, unchanged. The publisher reads QUALIA_FLY_MODE and QUALIA_FLY_PRIOR_PATH — both already declared in config/stack-manifest.default.json:57-58 as "off" / "", allow-listed in runners/watch/src/main.rs:67-68, and pinned by crates/braid/tests/manifest.rs:28-34 — takes approved_observe_only from the validated pointer exactly as the JEPA writers do, and derives sim_step, timestamp_ns = now_ns, runner_epoch = generation from one fixed dt = 0.001 s step per approved tick, with every write gated. Reading the env and emitting the lines inside lib.rs rather than main.rs is where #30 puts the construction. Its four log lines are new interface with no reference counterpart (note 3). match — feature-gated, and no reference surface is touched
5 Other surfaces #30 names — crates/fly-circuit/tests/sim.rs::step_is_deterministic exists and does what the ticket says: two independently loaded sims, the same drive for three steps, compared with to_bits (bitwise). crates/types/tests/layout.rs::fly_sim_slot_is_repr_c exists and asserts align 64, seq at 0, size_of::<FlySimSlot>() == 65_984 == 64 + size_of::<FlySimPayload>(), the twelve payload offsets, payload size 65,920, and FLY_SIM_MAX_TYPES * 4 == 65_536. The #[repr(C)] the ticket asks for is the macro's #[repr(C, align(64))], the reference's own spelling. The version bump is the constant SHM_VERSION = 3 plus its pin. match
6 Provenance gate (D-001) — python scripts/provenance_check.py, run in the worktree at this head: exit 0, provenance: OK; compared 146 authored file(s) (1 generated skipped); 0 identical, 38 EOL-identical, 8 code runs over 20, 0 prose runs over 2; the longest code run is 40 lines in crates/types/src/lib.rs — measured raw, the longest identical block in that file is 72 lines and is the pre-existing JepaEvidencePayload declaration, which this diff does not touch. This PR's additions are its own text: the reference has no fly declaration to share. The clean-room verdict is that reviewer's; this row records the gate's own numbers. OK

Scope

git diff --name-only $(git merge-base origin/main c4d9045) c4d9045:

Cargo.lock
crates/fly-circuit/src/rate.rs
crates/shm/src/lib.rs
crates/shm/tests/shm.rs
crates/types/src/lib.rs
crates/types/tests/layout.rs
runners/jepa-runtime/Cargo.toml
runners/jepa-runtime/src/lib.rs

#30 names crates/types/src/lib.rs, crates/types/tests/layout.rs, runners/jepa-runtime/src/lib.rs and the two test paths; runners/jepa-runtime/Cargo.toml carries the sim feature and the optional dependency the step needs. The other four are what the change cannot be built without: crates/shm/src/lib.rs and crates/shm/tests/shm.rs own the region's offsets and accessors, and that is where "a new SHM slot ... and a bumped SHM layout version" lands; crates/fly-circuit/src/rate.rs carries the one accessor the publisher sizes by; Cargo.lock is the optional-dependency edge (generated, and the gate skips it). Nothing outside that set. No doc or README edit is owed: this repository has no SHM layout document (docs/contracts/ holds only README.md and planner-service-v1.md), and the reference's own docs/contracts/shm-region-v1.md:11 defers the remaining regions to crates/shm/src/lib.rs. In scope.

Notes (4, non-blocking)

  1. JEPA_REGION_SIZE keeps its name while its meaning widens. The fly slot is appended inside the versioned-additions region, so the header's jepa_region_size now covers a slot that is not JEPA, and the constant's doc comment still reads "Extent of the append-only JEPA region, from JEPA_REGION_OFFSET to its end". The placement and the bump are the ticket's, so this is not a mismatch — but the header field is frozen interface under D-009, and one sentence saying the region is the versioned-additions region (or a decision note) would stop the next reader from assuming its extent means JEPA slots only.
  2. qualia-fly-circuit's public API is no longer exactly what T14 fly-circuit crate #29 froze. CircuitSim::type_count() is additive, safe, and needed — the publisher must size its drive to the prior's type count before step, which asserts on the input length — but neither ticket's Steps names it, so the crate's fixed surface grew in T15. Worth knowing when T14 fly-circuit crate #29's review record is read.
  3. QUALIA_FLY_PRIOR_PATH is required by the publisher and named by neither ticket's Steps. QUALIA_FLY_MODE=sim alone disables the simulator with fly sim: disabled (QUALIA_FLY_PRIOR_PATH is unset). The key is already the manifest's (empty default treated as unset) and the watch allow-list's, so the code is right and the ticket text is what lags. The four new lines themselves (fly sim: disabled (...)) are unpinned new interface: the reference has no fly line for D-008 to hold byte-identical, and they are the only lines this binary emits without its qualia-jepa-runtime: prefix — the prefix every existing line of this runner carries. The correctness leg's note 2 names the same thing; a literal assertion is worth adding when a consumer lands.
  4. FLY_SIM_MAX_TYPES's rationale cites a dataset the prior does not read. The doc comment justifies the 16,384 cap with "The whole-brain FlyWire annotation names 8,453 cell types", while the prior this slot is sized for is built from the Male CNS dataset (crates/connectome-prior/README.md), and no artifact in the tree records the type count a published prior will carry. The cap is generous and the refusal is logged rather than truncating, so nothing is blocked — but as written the rationale is unverifiable in-repo.

Verdict: approve for the contract leg at c4d9045. Every reference-comparable name is the reference's — package names, the sim feature's shape and default, the #[repr(C, align(64))] slot and payload mechanics, the flag and SnapshotError vocabulary, the epoch fields, and the pointer gate — the type itself is new interface that only #30 defines, the only constants that move are the two #30 explicitly bumps, and the diff stays inside the ticket's files plus the layout-accessor, feature and lock entries the change cannot be built without.

@superposition

Copy link
Copy Markdown
Owner Author
agent: Board3
branch: none (board evidence for the PR head, ticket/T15 #30)
commit: c4d9045054ab85694b2287702abf51e3c5b4713d
state: evidence
next: Main merges #189; the sim publisher has run on aarch64 here
blocked_on: none
evidence: this comment; board tests 2026-09-02 05:06–05:15 board clock

Board (Pinkie, aarch64) run at c4d9045

Head read at the start: gh pr view 189 --json headRefOid = git ls-remote origin refs/heads/ticket/T15
= c4d9045054ab85694b2287702abf51e3c5b4713d. The tree is a git archive of that sha shipped to the
board (T15c-src.tar.gz, sha256 03a4af03473ce4f9bfe47acfb757e999ba94d357e99a3c1ef0169cab794341a0); no
repository file on the board was edited. Board: rustc 1.94.0 (4a4ef493e 2026-03-02), cargo 1.94.0,
6 cores, RUSTFLAGS="-C target-feature=+fp16" per D-016 (the closure carries candle-core), with the
board's warm target dir reused. Tree hashes as built:

5ad16e46c5282e44aa8ec9acc89826bbae18219c4d356462b60b77ac3d38207a  runners/jepa-runtime/src/lib.rs
6250efee0fe292cc20e9a7a1351c885e588c7e2e56e9437954d98105e2d3ab95  runners/jepa-runtime/src/main.rs
d28963225d7f2c2c38ad893c40fae97c2359c6c7b979e311539190e298c09b63  crates/types/src/lib.rs
7e4b39bb07dd685943150b2b264720f6f76eff1d501d5e21830968f596f5b610  crates/fly-circuit/src/rate.rs
d480920b59fce3e822b112391d7ef30db8e64b601111ecaa4ec4834f08b65623  Cargo.lock

The ticket's own test command, with the fly sim: lines

$ cargo test -p qualia-jepa-runtime --features sim --offline -j 2 -- --nocapture
running 8 tests
fly sim: disabled (QUALIA_FLY_PRIOR_PATH is unset)
fly sim: disabled (QUALIA_FLY_PRIOR_PATH is unset)
fly sim: disabled (read: /tmp/.tmpq5xM7F/absent/manifest.json: No such file or directory (os error 2))
test tests::generation_pointer_requires_explicit_observe_only_approval ... ok
test fly_sim_tests::fly_sim_is_absent_unless_the_mode_is_sim ... ok
test fly_sim_tests::fly_sim_disables_itself_when_the_artifact_does_not_load ... ok
test fly_sim_tests::fly_sim_publishes_only_while_observe_only_is_approved ... ok
test tests::action_correlation_weights_overlaps_and_demands_coverage ... ok
test tests::quality_gates_match_materialization_and_range_saturates ... ok
test tests::incoherent_or_stale_sources_never_reach_the_model ... ok
test tests::coherent_tick_publishes_evidence_and_rollback_keeps_foreign_slots ... ok
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 54.28s
     Running tests/smoke_binary.rs
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 27.15s
JEPA_RUNTIME_TEST_RC=0        (4m 31.857s wall)

The three fly sim: lines are the refusal path on aarch64 (QUALIA_FLY_PRIOR_PATH unset, blank, and a
prior that does not load), and fly_sim_publishes_only_while_observe_only_is_approved is the publisher
path: it builds a three-type cycle prior (manifest.json + graph.bin), ticks unapproved (nothing
published), then approved (sim_step 1 then 2, abi_version, type_count, flags, epochs, sim_id,
dt, resting zeros) — the ticket's #[repr(C)] slot and SHM_VERSION 3 verified on the robot's
architecture.

$ cargo test -p qualia-types --offline -j 2
   11 passed (src/lib.rs) + 9 (tests/abi.rs) + 11 (tests/entity.rs) + 2 (tests/layout.rs,
   incl. fly_sim_slot_is_repr_c) ; 0 failed      TYPES_TEST_RC=0      (16.260s)

The --features sim publisher start, with a real prior

runners/jepa-runtime has no README and names no publisher command, so the run below is the suite's own
smoke test — the one that spawns the built binary against a live SHM region and an installed generation —
with the fly environment inherited so the publisher is constructed for real:

$ QUALIA_FLY_MODE=sim QUALIA_FLY_PRIOR_PATH=$HOME/t15-prior \
  cargo test -p qualia-jepa-runtime --features sim --offline -j 2 binary_attaches -- --nocapture
stderr: qualia-jepa-runtime: observe-only backend=cpu generation=1 checkpoint=smoke-gen shm=/qualia_jepa_c42_smoke_205445
test binary_attaches_to_a_live_region_and_reports_its_generation ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 27.50s
PUBLISHER_SMOKE_RC=0

No fly sim: disabled line appears, so FlySimPublisher::from_env built from the real prior and the
binary ran a tick loop with it attached. Note precisely what this pins: the smoke asserts the startup
line, not the slot contents — the slot bytes are asserted by the unit test above.

A bare bounded start cannot reach the publisher at all: main opens the SHM region before loading the
generation, so with QUALIA_JEPA_ENABLE=1 QUALIA_JEPA_MODE=observe-only QUALIA_FLY_MODE=sim QUALIA_FLY_PRIOR_PATH=$HOME/t15-prior and no live region the process prints
qualia-jepa-runtime: OS error 2 and exits START_RC=1 (a publisher-only run needs a live region plus an
installed generation, which the smoke above provides in-suite).

$ cargo build -p qualia-jepa-runtime --features sim --offline -j 2
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 04s     BUILD_RC=0
$ file target/debug/qualia-jepa-runtime
ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked,
  interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=f25f8698e38b44eb0e5153bfcd812d78834702b3,
  for GNU/Linux 3.7.0, with debug_info, not stripped
$ sha256sum target/debug/qualia-jepa-runtime
9f918a16d1e6cc9202d66192cfc936d112a51d379b6ae0de21191b82cf369286   204807408 bytes

Not exercised / not claimed: no interactive operator flow (the runner is a service; the TUI is a
different ticket), no long-running publisher soak, no --release build, nothing about the private tree.
One board quirk: its clock is ~9.5 days behind the host, so tar reports future timestamps; nothing
else varied. No long-running process was left behind.

@superposition
superposition merged commit f80a2df into main Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T15 FlySimSlot observe-only

1 participant