Repository navigation
T15: the FlySimSlot ABI, observe-only (#30) - #189
Conversation
6ca9a18 to
c4d9045
Compare
Rebase done; the runtime half is now in this diff. How the runtime half came over. What I resolved, and why. There was one overlap:
Host evidence at The PR description's braid and its "runtime publisher (stacked, not in this diff yet)" section are |
Reviewed head Reproduced build and testsFive commands, exactly the ones the rebase braid quotes, each reproduced at this head: Every summary matches the PR body and the rebase braid line for line. The ticket's two named tests both exist and pass: ABI table, and the reference comparison
Arena placement, printed by a throwaway probe ( Reference comparison (read-only
Observe-only evidence
A never-written slot: zeroed, seq 0, no faultI added my own throwaway test (deleted afterwards) that creates a real zeroed arena and reads the slot before anything writes it: It asserts The publisher's observable behaviour
plus the oversized-prior line in Falsification of one ABI claimIn a copy of the tree ( Restored, the same test passes and the restored file is byte-identical to the head tree: Notes (3, non-blocking)
Verdict: approve — the diff does what #30's step 15 says (slot declared beside |
Clean-room read of
|
| 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.rs586–625 ↔ 539–578, 40 lines — theAppliedActionSlot::publishseqlock
write body (let writing = current.wrapping_add(1)…self.seq.store(published, Release)). This is
implementation, but it is not in the diff: blameea12d32a, ancestor of the merge base. The file's
added hunk starts at line 1258; lines 586–625 are untouched.runners/jepa-runtime/src/lib.rs1263–1276 ↔ 993–1006, 14 lines — theAppliedActionSnapshot
fixture in the existing test module (producer_epoch: 1, …..AppliedActionSnapshot::default()).
Blameb7c9c936, ancestor of the merge base; the added test module is at 1648+.crates/shm/src/lib.rs334–346 ↔ 522–534, 13 lines — thepub fn write_weight_tile(&self, layer, tile_row, tile_col, tile_size, values)signature plus itsassert!/assert_eq!argument guards.
Blamed3bdbfdb, ancestor of the merge base; the added lines are the offset/accessor at 168–175 and
537–541.runners/jepa-runtime/Cargo.toml21–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. Blame525e5195, ancestor of the merge base; the added keys are the
simfeature andqualia-fly-circuitdep 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)
- The brief's "interface" premise has no counterpart in the measured reference. The task expected
theFlySimSlotABI/identity strings and the fly log lines to be interface copied from the private
engine.C:/qualiaat733329dcontains none of them (checked by path, bygit grep, and by
git log --all -S). The ABI, theFLY_SIM_*constants,SIM_IDand thefly 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 realFlySimSlot, the contract leg should compare against that revision. - 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. - The one in-diff gate over-threshold file is inherited.
CODE RUN 40: crates/types/src/lib.rsis
theAppliedActionSlot::publishbody at 586–625, blamed toea12d32a, an ancestor of the merge base;
T15 touches the file only at lines 22, 34–46, 1261–1320, 1382, 1577. - Byte-identity arm. 0
IDENTICAL, 38EOL-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.
Reviewed head Surface table
Scope
#30 names Notes (4, non-blocking)
Verdict: approve for the contract leg at |
Board (Pinkie, aarch64) run at
|
What this is
Step 15 of #5, the observe-only half: the
FlySimSlotABI and the runtime publisher that fills it.FlySimSlotis declared incrates/types/src/lib.rsnext toJepaTelemetrySlot, behind#[repr(C, align(64))], andSHM_VERSIONgoes 2 -> 3 because the append-only JEPA region grows a slot:crates/shm/src/lib.rsgainsFLY_SIM_OFFSET(after the applied-action history) and afly_sim()accessor, and
JEPA_REGION_SIZEnow ends at the fly slot.crates/fly-circuitgainsCircuitSim::type_count(), which a publisher needs to size both its drive and its published vector.The payload carries one
f32per prior type plus what an observer needs to interpret it: the writer'sABI 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_IDand 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)FlySimSlot:seqat 0, payload at 64, size 65,984, align 64.FLY_SIM_MAX_TYPESis 16,384 f32 — thewhole-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.rsgains asimfeature (off by default) andFlySimPublisher: built inObserveOnlyRunner::openfromQUALIA_FLY_MODE=simplusQUALIA_FLY_PRIOR_PATH, it stepsCircuitSimone fixed 1 ms step per tick and publishes into
shm.fly_sim()only while the live generation pointercarries
approved_observe_only. A publication failure drops the publisher with a log line; the monitornever 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
75b8ca3onticket/T15-runtime, branched fromticket/C42(b7c9c93), becauserunners/jepa-runtime/src/lib.rsdid not exist onmainandcrates/jepa-modelwas a one-line stubuntil #169 merged. Both bases are on
mainnow (#180, #169), so that commit was cherry-picked onto theABI commits here as
c4d9045; itsCircuitSim::type_count()was textually identical to the ABI commit'sand folded into one copy, and
Cargo.lockpicked up the runtime crate's new optional dependency edge.Building that former stack
C42 + C09 + the ABI commitin a scratch worktree:and the same command without
--features simcompiles clean, no warnings.Evidence
Host at head
c4d9045, after the rebase, one-j 2build each:fly_sim_slot_is_repr_cwas 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 agit archivetree with the workspacetrimmed to
crates/types+crates/shm,Cargo.lockmoved aside and re-locked--offline,-j 2):The board clock is ~9.5 days behind the host, so
tarreports future timestamps on extract; nothingelse differed from the host run. The board numbers above are from the pre-rebase head; the board leg for
c4d9045is Main's to dispatch.Files
crates/types/src/lib.rs—FlySimPayload,FlySimSlot,FLY_SIM_*,SHM_VERSION3crates/types/tests/layout.rs— the ABI and the observe-only seqlock behaviourcrates/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 arenacrates/fly-circuit/src/rate.rs—CircuitSim::type_count()runners/jepa-runtime/src/lib.rs,runners/jepa-runtime/Cargo.toml— thesimfeature andFlySimPublishercrates/shmis outside the ticket's original file list and is required by its own words: a slot declaredin
qualia-typeshas no place in the mapped region, and no accessor, without the placement constant thatlives with every other offset. It is three additive changes, no existing offset moves.
Closes #30