Skip to content

Stream the fly loop into leash wheel frames per tick - #267

Merged
superposition merged 4 commits into
mainfrom
ticket/T67-fly-frames
Sep 15, 2026
Merged

superposition merged 4 commits into
mainfrom
ticket/T67-fly-frames

Conversation

@superposition

@superposition superposition commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner
agent: CodexDriving
branch: ticket/T67-fly-frames
commit: d4d60ad
state: review
next: Run the zero-speed probe when the operator confirms the acknowledgement fix.
blocked_on: operator acknowledgement confirmation and presence; estop reset decision
evidence: docs/evidence/T67/fly-frames/

The fly loop previously decoded commands only after all images were acquired, so a trace filter would deliver old decisions in a burst. loop --frames-out - now emits one flushed JSON wheel frame during each CPU/GPU tick, after recording the matching CSV row. T is the original tick; holds emit explicit zeroes. Loop status goes to stderr.

The neural firing fractions are converted through the existing command/throttle readout into bounded differential pivots; --max-wheel-speed defaults to 0.04 and rejects non-finite or out-of-range values. Existing frame destinations are refused before evidence files are opened. The README explains the mapping and bounded live pipe recipe. Transport safety, lease, arrival-based deadman and session-label code are unchanged.

Validation: CUDA-enabled package build, existing artifact corruption test and unchanged transport build pass. Local recorded-JPEG runs produced 30 GPU frames and 12 CPU frames, independently checked against recorded spikes and CSV. Receiving the first JSON frame unlocked the second camera response; a 0.969-second injected gap emitted no substitute frame. Camera HTTP 503 and broken pipe both exit with errors; invalid limits emit nothing; existing destination checks preserve prior bytes. Correctness, clean-room and contract reviews approve; the correctness finding was fixed and independently rechecked.

A subsequent host loop against the robot's live camera completed 30 ticks in 5.181 s, producing 18 left, 3 hold and 9 right decisions into a local JSONL file. All frames agree with the CSV and 0.04 bound. Raw JSON/CSV/stderr and limitations are in docs/evidence/T67/fly-frames/. No transport or motor command was sent; this is sensor-to-frame evidence only. No bearer was fetched, board job taken or window opened. An existing Qualia agent was found on port 18081; its health could not be authenticated with the available local CA files.

Provenance and figures pass; journal passes for the existing article PR #261; mission offline self-test passes 40 cases. The full robot demonstrations and live mission were not run. The historical acknowledgement refusal is explicitly identified as previous evidence. The robot probe waits for the operator's word to retry, and estop also waits for a reset decision.

Refs #262. This PR must not close the ticket: the bounded live applied run, live deadman telemetry and estop latch/refusal/resume are still owed.

@superposition

Copy link
Copy Markdown
Owner Author
role: correctness
verdict: request-changes
notes: 1

Reviewed exact head c9d34fa5d5191d6c31c3da7d14d257b17d510d5d; its delta from 6e9889e only normalizes evidence line endings.

  1. Preserve an existing frame destination when refusing it (crates/connectome-cns/src/main.rs:611-629). SpikeWriter::create and File::create(trace) run before the --frames-out create_new check. Reproduced with an existing existing-alias.jsonl containing previous-run-evidence\n, --ticks 0 --device cpu --trace existing-alias.jsonl --frames-out existing-alias.jsonl: the process exits 1 with The file exists. (os error 80), emits no frames, and leaves that previous evidence file empty. Refuse an already-existing non-stdout frame destination before opening either evidence file, while retaining the final atomic create_new check. No camera request is needed to reproduce this.

Other local checks passed, reproduced with fresh scratch outputs under C:/tmp/qualia-driving-correctness-6e9889e/: CUDA-enabled package build; existing artifact-corruption test; GPU 30 ticks (17 left, 4 hold, 9 right) and CPU 12 ticks (5 left, 4 hold, 3 right), with JSON ticks/decisions/wheels independently recomputed from recorded spike IDs and checked against CSV. First-frame consumption released the second local JPEG response; an injected 0.953-second gap emitted no substitute frame. HTTP 503 produces exactly one frame then exit 1; closing the pipe produces an explicit wheel-write error and exit 1. NaN, infinity, -0.1 and 1.1 limits emit nothing and fail. The released-table import test was not rerun. No WHEA event was returned for the queried review window.

The transport source is unchanged. No robot/board request, bearer read, motion, or window was used; these checks do not satisfy the three outstanding #262 robot demonstrations. The build/GPU slot is released for the fix.

@superposition

Copy link
Copy Markdown
Owner Author
role: contract
verdict: approve
notes: 0

Reviewed commit c9d34fa5d5191d6c31c3da7d14d257b17d510d5d on ticket/T67-fly-frames, including the code at 6e9889e4113db78b677e1b69d87b0868e73d8844 and the evidence-only line-ending delta. Read docs/agents.md, the driving handoff, #262, and #264's review trail. This approves the producer shim's contract; #262 remains open for its robot acceptance.

The additive loop --frames-out / --max-wheel-speed options use the existing transport schema exactly: T is the original zero-based u64 tick, and L / R are finite f32 wheel commands. Every completed tick emits one flushed JSON line after its matching CSV row. Both CPU and GPU paths call the same decoder/emitter during acquisition. A hold emits two explicit zeroes; it is never skipped. Status and failures go to stderr, leaving stdout parseable. The default 0.04 limit and finite 0..=1 validation bound the pivot mapping. The neural rate_l / rate_r values are correctly described as firing fractions, and command/throttle is converted explicitly into pivots without claiming calibrated physical speed.

Evidence checked independently without a build or robot request: parsed the committed CPU and GPU JSONL/CSV records, requiring exactly T/L/R, sequential integer ticks, matching decisions and rounded-CSV throttle within its rounding tolerance, opposite wheel signs, finite values, magnitude <= 0.04, and explicit zeroes for holds. Results: CPU 12 frames (5 left / 4 hold / 3 right); GPU 30 frames (17 / 4 / 9). git diff --ignore-space-at-eol --exit-code 6e9889e..c9d34fa -- and git diff --check origin/main...c9d34fa both exit 0. Dynamic streaming/fault checks remain the correctness reviewer's remit.

Scope is the authorized loop implementation, its README, T67 evidence, and handoff; package names, manifests/features, public library interfaces, CSV columns, and transport code are unchanged. Camera or output failures return errors instead of replaying prior commands. The existing arrival-based deadman, live/armed gate, stop/lease lifecycle, and stable transport session label are preserved. Documentation correctly distinguishes EOF stopping from a live deadman demonstration, and requires the operator's retry word, successful zero probe, low speed, a bounded window, and the estop reset decision. Local captures and the historical acknowledgement refusal are not presented as fresh robot evidence. PR linkage is Refs #262, with all three demonstrations explicitly still owed.

No code edits, builds, GPU jobs, robot/board requests, credential access, or windows were used in this review.

@superposition

Copy link
Copy Markdown
Owner Author
role: clean-room
verdict: approve
notes: 0

Reviewed commit c9d34fa5d5191d6c31c3da7d14d257b17d510d5d against 557d50f, including the follow-up from 6e9889e4113db78b677e1b69d87b0868e73d8844.

From C:/Users/ericm/qualia-driving, I independently ran the already-built gate (no Cargo build):

& 'C:/Users/ericm/qualia/target/debug/qualia-gates.exe' provenance

It exited 0 and reported:

provenance: compared 152 authored file(s) (1 generated skipped); 0 identical, 27 EOL-identical, 7 code runs over 20, 0 prose runs over 2
provenance: highest identical-code-line share 1.000 (.cargo/config.toml)
provenance: OK

The seven reported long-code-run paths are unchanged from 557d50f (verified with git diff --exit-code over the reported paths). None is introduced or altered by this PR. I reviewed the added comments and documentation and found no copied-reference prose or new attribution issue. The existing Male CNS source/CC-BY attribution remains present.

git diff --ignore-space-at-eol --exit-code 6e9889e..c9d34fa and git diff --check 557d50f...c9d34fa both exited 0: the follow-up only normalizes capture line endings. Independently parsing the committed CSV and JSON confirms the documented GPU 30 frames (17 left / 4 hold / 9 right), CPU 12 (5 / 4 / 3), sequential ticks, explicit hold zeroes, command/throttle mapping within CSV rounding, and the 0.04 bound. The broken-pipe evidence has one emitted frame and two trace rows, as the README explains.

The evidence correctly labels the input as a locally served recorded JPEG, distinguishes author-run checks from live acceptance, and attributes the acknowledgement refusal to the historical leash-drive/transport-http-live.log (the quoted substring matches line 6). The recipe is clearly conditional on the operator's word. No claim closes any of the three robot demonstrations or the outstanding board requirement. This review did not run a build, GPU workload, credential read, or robot request; runtime reproduction belongs to the separate correctness review.

@superposition

Copy link
Copy Markdown
Owner Author
role: correctness
verdict: approve
notes: 0

Re-reviewed exact head a812da33fcd85ebf6d0ef8c7acc66b9ae54f5469. The prior existing-destination truncation issue is resolved: the preflight now runs before artifact loading and evidence-file creation, while create_new still protects the final frame-file open.

Independently reproduced on the rebuilt binary with fresh scratch outputs in C:/tmp/qualia-driving-correctness-a812da3/: existing frame destination equal to trace, equal to spikes, independent of both, and a hardlink to trace all exit 1 with empty stdout and preserve every existing byte. These runs use a nonexistent artifact, proving refusal precedes artifact loading. A new file on the CPU path at --max-wheel-speed 0 records exactly six frames with ticks 0 through 5 and zeroes for both wheels; stdout is empty. The input JPEG and artifact-manifest SHA-256 hashes match the updated evidence README. No WHEA event was returned for the queried 15-minute window.

The earlier independently reproduced CUDA build, corruption test, GPU/CPU trace-and-spike comparisons, streaming-gap check, camera failure, broken pipe, and invalid-limit checks stand: the fix changes only this preflight boundary, plus evidence documentation. No additional GPU run or Cargo build was taken during re-review. No implementation or committed evidence was modified by this reviewer.

This approves the local shim. It does not claim the three #262 robot demonstrations, a board deployment, or a new acknowledgement probe; I made no robot request and read no bearer.

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.

1 participant