Commit graph

552 commits

Author SHA1 Message Date
acamilo
d501db689c docs: GPU on a build box (dev and benchmarks) section 2026-10-02 12:48:29 +00:00
acamilo
6759555744 docs: v0.7.8 status 2026-10-02 12:27:21 +00:00
acamilo
e4d9d7c9ff Merge port/bus-02 (reviewed: APPROVE-WITH-NOTES; N1-N7 fixed with tests, live speakers soaked): cheaper bus round trips (seal-on-reply, recycled zero-filled staging writers, encode once); session bus transport still off 2026-10-02 12:25:09 +00:00
acamilo
e1f594425e Merge port/gpu-02 (reviewed: APPROVE-WITH-NOTES; N1/N2 fixed: a dead GPU makes the process CPU-only and the replacement restores on the CPU): the GPU brain steps a whole frame per call with state resident on the card (cuda feature, off by default) 2026-10-02 11:51:47 +00:00
acamilo
9a4542de5f flybus: zero-fill a recycled staging file in place instead of truncating and reserving it again
Freeing the blocks and faulting them back in on the producer's next write cost about 36 us a
92,160-byte reply on tmpfs; writing zeros over the blocks already there costs about 10 (rtt,
process mode, interleaved against the branch before the review round). Same guarantee: a
reissued writer reads as zeros, as a fresh allocation does.
2026-10-02 10:59:47 +00:00
acamilo
7d2650ae5e gpu-02 notes: a GPU failure falls back to the CPU for the process lifetime
A CUDA failure (a failed batch or read-back, or an attach that fails at a restart) now marks the
GPU unusable for the process: the replacement agent worker is created on the CPU and restores the
last checkpoint, so a lost device no longer leaves the session unable to restore and a flaky one is
never re-attached in a loop. Worker processes share the record through a marker file the launcher
owns and empties when it starts. Exposed as the LIF_GPU_FALLBACK log line,
fly_brain_backend{backend}, fly_brain_backend_wanted and fly_brain_backend_fallbacks_total, and
fly-watchdog check 11 (report only).

Adds a committed fault-injection hook for the cuda feature (FLY_LIF_CUDA_FAULT or the inject
setters), the recovery harness in legacy_parity, and the cuda_fallback test: init failure, transient
(host current) and permanent (in-process and process) faults, each equal to the CPU reference.
Corrects the runbook, documents the stale host arrays on LifNetwork, and has cuda_session assert
that no fallback hid a CPU pass.
2026-10-02 10:15:03 +00:00
acamilo
da8fa2a927 Merge main (v0.7.7: row 73 + notes, feed and control over flybus, integration feed-rate, BUS-01 notes) into port/bus-02 2026-10-02 10:14:26 +00:00
acamilo
6a92a1902b BUS-02 review notes: recycled writers zero-filled, replays wait for the sealing reply, typed seal failures
The feed and the control API run over flybus in production, so these notes are treated as
live-path correctness.

- N3: the router empties and re-reserves a recycled writer's staging file before reissuing it,
  so no artifact sealed from it (by prefix or whole) carries the previous artifact's bytes;
  ArtifactWriter::seal's doc now holds for every writer. contractDigest text says so.
- N2: a sealing reply is sent with the worker's result cache held, so a duplicate replays the
  sealed artifacts instead of attaching the still-unsealed writer.
- N1: a refused sealing reply is answered as the handler's own seal failure was before BUS-02
  (BACKEND_FAILURE, mutation applied), cached the same way, worker marked failed, and logged.
- N5: a failed staging rename unlinks the writer's own staging file.
- N4: recycle without a sealing attachment is refused even when false; one writer named by two
  attachments is refused as INVALID_ENVELOPE; the SDK checks writers on rpc.call and publish
  replies too.
- N6: the store-directory cache is per client connection; bus-v1 notes the residual case.
- N7: the fly-edge stall test waits for the feed topic; SERVE-01 parity accepts a refused
  /stimulate drained one frame late (retryAfterMs one frame apart, nothing else).
- tests: the review's adversarial lifecycle suite (sealing_lifecycle.rs); recycled-writer content,
  rename failure and recycle edges (sealing.rs); replay-vs-sealing and typed refusal in the worker
  shell; smaller-after-larger artifacts through fly-edge and fly-control-edge.
2026-10-02 10:14:23 +00:00
acamilo
37b3195b0b docs: v0.7.7 status
Some checks are pending
ci / node 22 (test + typecheck) (push) Waiting to run
ci / rust stable (cargo test --workspace --release) (push) Waiting to run
ci / infra/tests/lint.sh (push) Waiting to run
ci / playwright apps/stage (allowed to fail) (push) Waiting to run
2026-10-02 09:43:02 +00:00
acamilo
4b29f08c21 Merge fix/loop-row73-notes (coordinator review of the round; N5 cleared: no live watchdog rule fires): bad hidden-object entries skipped, room ledger forgotten on leaving, blocked one-sided targets release the exits 2026-10-02 09:42:53 +00:00
acamilo
49e48a5075 macros: row 73 review notes -- an errand room's talked entries are forgotten when the fly leaves it, a one-sided target with no standable tile is not waited for, an off-map hidden-event entry is skipped
N3: the talked ledger never forgot within a session, but the cartridge re-shows Bill after the fly
leaves and a Bill whose bag was full never hands over the ticket. While the objective is an errand in
a room the palette notes the room, and on the first frame the fly stands elsewhere with that errand
still the objective it forgets that room's talked entries (Talked::forget_map).

N4: a hidden event pressed from one side whose only stand tile is pushed had no aim, earned no
blocked entry and kept the exits withheld. It now leaves the errand's list at once (palette::servable).

N1: state::hidden_events skipped nothing; one entry off its own map voided the whole map's list. It
now skips that entry and keeps the others.

N2: the item-use dispatch doc comment is back on mod items.
2026-10-02 09:40:49 +00:00
acamilo
bbbfe4b68a docs: control runs over flybus 2026-10-02 07:56:18 +00:00
acamilo
5dad5b3cd7 Merge main into port/gpu-02 2026-10-02 07:49:17 +00:00
acamilo
7d817d8cee GPU-02: the session steps a frame per call, the CUDA backend keeps its state on the device
LifNetwork::step_frame runs a game frame's ticks in one call and ORs every
tick's spikes into the transition's bitset. On the CPU it is exactly the
one-tick loop the session ran; on the GPU it is one batch, with membrane
and refractory left on the device (device-owned state): per frame only the
noise draws, visual drive and plastic gains go up and the spike lists come
down, instead of 1.4 MB per tick (about 24 MB per frame) with the old
step(1) loop and per-batch host sync.

- LifBackend (cpu / cuda:<ordinal>) from FLY_LIF_CUDA / FLY_LIF_CUDA_DEVICE,
  set_backend, configure_sweep (set_sweep_plan without the test hook),
  sync_host, host_state_current, try_step, take_backend_fault.
- export_state downloads the device arrays itself while the host copy is
  stale, so no capture can read old values; the session syncs before
  State.Capture.
- A CUDA failure detaches the backend: if the host state was current the
  frame continues bit-exactly on the CPU, otherwise the agent fails and a
  restore in that worker runs on the CPU. Warm-up no longer panics.
- The legacy agent worker picks its backend explicitly and refuses a GPU it
  cannot have (no feature, no device) at Agent.Initialize instead of
  running the CPU under a GPU label. The FLY_LIF_CUDA hook in
  set_sweep_plan stays for the golden suite and the legacy loop.
- cuda passthrough features on fly-session and fly-legacy-session, so
  FLY_CARGO_FEATURES=cuda reaches flysim-session, fly-shadow, fly-session.
- Tests: step_frame vs the one-tick loop (state and bitset, 1 and 3
  threads), the backend switch; cuda_exact frame mode; a cuda-feature
  session test (FAFB, rollback, restore, checkpoints) against the CPU
  reference.
2026-10-02 07:49:17 +00:00
acamilo
0004ffaf36 Merge fix/loop-row73 (reviewed: APPROVE-WITH-NOTES): rung 16 is Bill's errand inside his house; hidden objects read from the cartridge's table are targets only as the errand's next step; Cerulean graph 2026-10-02 07:43:20 +00:00
acamilo
8b696f8f1c docs: the feed runs over flybus 2026-10-02 07:34:50 +00:00
acamilo
6a063d32b4 Merge fix/integration-feed-rate (ported from a stray archive worktree; 8/8 under load): the integration test asserts the feed's structure, not a wall-clock rate 2026-10-02 07:03:50 +00:00
acamilo
48aedd25ff Merge fix/bus-01-notes (coordinator review): bus shadow check refuses on the session runtime; worker children die with their parent (PDEATHSIG, spawned from async worker threads, never spawn_blocking); digest-mismatch test 2026-10-02 07:03:35 +00:00
acamilo
91d0214cbc flysim integration test: assert the feed's structure, not a wall-clock rate
The publish cadence is a 30 Hz wall-clock timer, so the 25..31 Hz bound failed on a
loaded box (22.5 Hz in the v0.7.6 gate). Log the rate, bound it only against the 2 Hz
idle path, and assert what is deterministic: contiguous seq, at least one frame per
snapshot, brain time advancing 16-17 ticks per frame.

Two more load-dependent races in the same test: /status read the boot header (a 1-rung
ladder) right after /healthz, and the first feed message after the restart could be the
frame-0 boot header. Wait for a running snapshot in both.
2026-10-02 06:20:46 +00:00
acamilo
9d5dd398ca Cargo.lock: the fly-edge dependency the EDGE-02/CTRL-01 merge resolution left out
Some checks are pending
ci / node 22 (test + typecheck) (push) Waiting to run
ci / rust stable (cargo test --workspace --release) (push) Waiting to run
ci / infra/tests/lint.sh (push) Waiting to run
ci / playwright apps/stage (allowed to fail) (push) Waiting to run
2026-10-02 06:06:08 +00:00
acamilo
29b51ff336 docs: implementation guide BUS-02 (port slice) entry 2026-10-02 05:30:31 +00:00
acamilo
6bc447a5bd docs: flybus README and bus conformance rows for sealing sends (BUS-02) 2026-10-02 05:23:08 +00:00
acamilo
4935dcc045 BUS-01 review notes: clippy fixes in the new tests 2026-10-02 05:15:45 +00:00
acamilo
210296a0ff docs: v0.7.6 status 2026-10-02 05:00:24 +00:00
acamilo
fc5a579027 Merge port/edge-02 (reviewed: r1 APPROVE-WITH-NOTES, r2 APPROVE): the video feed over flybus (off by default), fly-feed switch, aux cpus for the bus threads 2026-10-02 04:57:52 +00:00
acamilo
ef48a6aed9 Merge feat/scorecard (reviewed: BLOCK; B1/B2 fixed with the review's proofs): multi-seed play regression harness, per-checkpoint trap rule, v0.7.5 baseline 2026-10-02 04:56:04 +00:00
acamilo
a2449488a5 scorecard: the lockfile gains libc for the crate; docs for the trap rule, Holm and the throws metric 2026-10-02 04:40:14 +00:00
acamilo
0a35b393aa flybus: sealing sends, encode-once router, cheaper client hot path (BUS-02)
- bus-v1 section 12 amendment 2026-10-02: an rpc.call/rpc.reply/publish attachment may name the
  sender's own unsealed writer; the router seals its declared prefix on admission (copy outside
  the state lock), the writer becomes the sender's hold, and with recycle:true the staging
  allocation comes back as a new writer in the reply. A refused sealing send releases every
  writer it named. contractDigest changes.
- SDK: ArtifactWriter::into_unsealed, Responder::reply_sealing; no rpc.responder.release after an
  admitted reply; delivery payloads moved, not cloned; Fields without hashing.
- Router: every frame encoded once (id spliced at selection); admitted payloads forwarded as
  pre-encoded JSON instead of deep copies; seal copies via copy_file_range with a sized buffer;
  client location resolution caches the store directories.
- fly-session: result attachments kept as delivered (no artifact.retain round trip per
  attachment); reply artifacts sealed by the reply that carries them, writers recycled into a
  capacity-bucketed pool.
- tests: sealing.rs; artifacts.rs updated to the amendment. examples/rtt.rs measures a round trip.
2026-10-02 04:28:05 +00:00
acamilo
2bae8a7b6a macros-traps: row 73, with the multi-seed hunt before and after 2026-10-02 04:26:09 +00:00
acamilo
eaae6fd82a EDGE-02 notes: bus threads on an aux cpu (FLY_SESSION_AUX_CPUS, SESSION_AUX_CPUS in the deploy), fly-feed direct never rolled back, watchdog falls back to direct at the 4th failure and never reboots for the edge; runbook cost corrected 2026-10-02 04:22:39 +00:00
acamilo
49309a83bd scorecard: per-checkpoint trap rule, Holm over the metric family, throws count throws, children die with the suite, LegacyConfig fields
The compare could not fail a trap confined to one checkpoint: add a rule per checkpoint
(B trapped on two or more runs and two more than A, or a blocked-macro storm A lacks).
Holm-adjust the sign-flip p-values over the judged metrics (the unadjusted family false-failed
about 15% of releases). throws_per_hour counts THROW BALL done, not starts; blocked throws are
their own reported metric. run-one children get PR_SET_PDEATHSIG. runner.rs sets transport and
placements (main's LegacyConfig); overlay.sh drops those lines for trees without the fields.
2026-10-02 03:50:50 +00:00
acamilo
397a589fae Merge branch 'main' into feat/scorecard 2026-10-02 03:42:45 +00:00
acamilo
d5b576a2c1 Merge main into port/edge-02 (CTRL-01, BUS-01, row 72, parity flake fix) 2026-10-02 03:19:30 +00:00
acamilo
076a6bcbbf BUS-01 review notes: shadow check refuses on the session runtime (N1), workers die with their parent via PR_SET_PDEATHSIG (N2), test for the Hello digest refusal (N3) 2026-10-02 03:04:49 +00:00
acamilo
c6ab8247d9 Merge port/bus-01 (reviewed: APPROVE-WITH-NOTES): the session can run its agent and world over the flybus router on Unix sockets (off by default); per-frame work metric 2026-10-02 02:53:23 +00:00
acamilo
7dc744fe63 scorecard: the lockfile gains the crate 2026-10-02 02:29:15 +00:00
acamilo
ae05221495 scorecard: the v0.7.5 reference card and what it shows; the hunt's windows are reported, not judged 2026-10-02 02:28:16 +00:00
acamilo
3181c5ef7b scorecard: one thread per run and eight runs at a time, and --resume 2026-10-02 02:28:16 +00:00
acamilo
d7547085e5 scorecard: ten brain minutes, four threads, two jobs: the cost the box can bear 2026-10-02 02:28:16 +00:00
acamilo
ae5db47801 scorecard: the overlay can be run from a copy outside a checkout 2026-10-02 02:28:15 +00:00
acamilo
49bae21a4d scorecard: a multi-seed good-play regression harness (fly-scorecard)
A fixed checkpoint set x seeds x brain minutes on the real connectome, on the session runtime or the legacy loop, reduced to JSON: rungs per hour, empty pad, watchdog check 10 rules, ladder-worthy traps, the shop-to-catch funnel, heals, whiteouts, battles, blocked macros. Compare mode pairs two cards by (checkpoint, seed) and judges each metric with a sign-flip permutation test and a tolerance. PokeredTask gains a read-only with_reader for the harness.
2026-10-02 02:28:15 +00:00
acamilo
872dcfc214 docs: macros.md 12.35 and macros-wram.md 17 (row 73); the hidden-event list bound covers the Game Corner's 48 entries, checked on the cartridge 2026-10-02 02:18:22 +00:00
acamilo
24753db620 Merge fix/service-parity-flake (coordinator review: test-only): the parity test waits for the pause's idle header instead of racing it 2026-10-02 02:16:43 +00:00
acamilo
1ebf35d845 Merge main (v0.7.5 + loop-row72 + ctrl-01) into port/bus-01
service_parity: the control-bus runtime runs on SessionArm::LOCAL.
2026-10-02 02:05:33 +00:00
acamilo
0caade6b20 macros: rung 16 is an errand in Bill's house, its PC is a hidden event, and Cerulean's south is behind the trashed house (row 73)
Rung 16's place was at(ROUTE_25), so inside Bill's house GO OBJECTIVE and GO OUT were both the
door: the live Route 25 <-> Bill's house ring. It is now errand(BILLS_HOUSE): the room's people
first, then its things, where the things include the cartridge's own hidden events, read from
HiddenEventMaps/HiddenEventPointers ($11:$6A40/$6A96, pinned from CheckForHiddenEvent's operands
and shape-checked on every read). A hidden event is only ever the errand's next step: GO ITEM,
GO NPC and TALK elsewhere are unchanged. One with a SPRITE_FACING argument (Bill's PC) is
approached and faced from that side only.

Cerulean is split a third time: the town's ground ends at row 28, and Route 5 and Route 9 are on
the ground behind the trashed house ($3e), in by its front door and out by the hole in its back
wall. The house is on the map graph, so the objective toward rung 17 walks through it.

ROM tests from the scout checkpoints (door ring, PC step, live row-71 Route 25, Cerulean
south-half and trashed house) fail on main and pass here. No button, readout, catalog or adapter
change; the compatibility string is unchanged.
2026-10-02 02:05:33 +00:00
acamilo
7d98fbf8ba Merge port/ctrl-01 (reviewed: APPROVE-WITH-NOTES; N1 edge follows flysim, N2 large bodies as artifacts): control API as flybus RPC with per-agent grants, off by default 2026-10-02 01:44:56 +00:00
acamilo
d50914e4c7 control edge follows flysim's stops and starts; large request bodies match direct
N1: flysim.service Wants= flycontrol-edge.service and the edge gets an ExecCondition on FLY_CONTROL_VIA
(no [Install]), the pattern flyedge uses, so fly-loop-reset's stop and start brings :7401 back in bus
mode and the edge stays skipped in direct mode. lint.sh checks the wiring and runs the condition;
runbook and flybus.md updated (no enable step).

N2: a request body over 48 KiB of JSON travels as a sealed request artifact, so the edge answers
what direct answers instead of 503 INVALID_ENVELOPE. parity test covers 49 KB to 300 KB bodies on
/chat, /stimulate and /reward plus an unparseable large body.
2026-10-02 01:43:34 +00:00
acamilo
3ea56ef3f8 tests: service_parity waits for the idle header instead of racing the pause
The idle-headers check failed 8 of 12 runs on a loaded build box (main
46e25ef: 3 of 4). The script paused and resumed 2 ms apart, so whether the
loop published a header-only idle snapshot in that window (due at 2 Hz) was
wall-clock luck, and legacy and session often disagreed. Not a product race:
the cadence is the protocol's.

The recorder now holds the resume until the first idle header has been seen
(bounded wait, 30 s), and the compare requires BOTH runtimes to have published
one, rather than merely agreeing on whether any did. The first idle header is
compared as before except for its `events` list: which publish carries the
pause's events is wall clock, and the events are compared in the running
snapshots and the event log.

Also fixed, found once the first was gone (1 in 20 under load): the two
sugars sent at one frame must be drained together; when the loop publishes
a snapshot while they are being sent the run is flagged incomplete and
repeated, like a missed frame.

What it proves, unchanged: a pause makes each runtime publish header-only
idle snapshots (status paused, no attachments) whose fields match the legacy
loop, and the script's responses, feed, event log, journal and final
checkpoint are identical between runtimes.

Under load (build box, load ~25 on 6 cores), toy_raw_service_contracts:
before 4/12 pass, after 40/40.
2026-10-02 01:12:56 +00:00
acamilo
74a3c12857 Merge fix/loop-row72 (coordinator review: test-only, both tests stale): the GO SHOP and GO HEAL ROM tests start where the macro is dealt 2026-10-02 00:44:35 +00:00
acamilo
1382f94cf3 runbook: what the rehearsal measured 2026-10-02 00:43:32 +00:00