Skip to content

feat(tools): record gate selections, cache-safe edges and five tests on zero DSP - #986

Merged
m-dwyer merged 8 commits into
mainfrom
tools/test-speed
Dec 5, 2026
Merged

m-dwyer merged 8 commits into
mainfrom
tools/test-speed

Conversation

@m-dwyer

@m-dwyer m-dwyer commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator

What each part does

  • Selection record (f863007c6, 168aacc0b): the gate writes each selection (selected and skipped tests, with the rule that chose them) and reports minutes by rule. It is report-only; skip reasons come from their owner.
  • Cache-safe edges (23313cdec, 5eb537048): drops the blanket device and core/runtime service project edges, and keeps the edges the rig and assembly targets actually read.
  • Zero-DSP device tests (0307c337f, fc4e00ad6): device tests that do not need SHARC run with the DSP off. The bootscreen pair was tried and reverted to the coupled SHARC (fc4e00ad6).
  • Plan: docs/plans/test-selection-by-reads.md (spike results, DSP audit, test-speed order).

Measured

Zero DSP against SHARC: debug-observers 29 -> 6 s, system-package-restart 148 -> 75 s.

Gap the edge fix closes

On main, rig-only modules (about 15) had no patchkit edge, so a patchkit edit did not select their rig targets (test-dsp, test-dsp-conformance). The branch adds them.

Static proof

  • Plan replay (test-plans.mjs, 22 samples, origin/main code vs branch code, before and after run one after the other): device-half lines are identical in every plan. Task lines differ once: digikit/project-manager:lint dropped in 01b2ed0 (a blanket edge removed). The test:subset line differs in 14 plans only as coupled tasks moving to zero-DSP with the total unchanged (e.g. 10/10 -> 8/12), which is the tests moved to zero DSP. Two plans (01b2ed0, d4d0724) were rerun singly on both sides and gave the same differences. No sample touches patchkit, so the added rig targets do not show in the replay.
  • Ledger (origin/main vs branch): 0 removed, 0 moved. 86 added: 10 are tools/nx/tests/selection-record.test.mjs; the rest are device and wasm test files this branch does not touch, which list differently in a clean checkout without local build outputs (file-write, voice-path, settings-api, store-format, usb-bulk, shot-peer, @digi/web wasm), plus case lists of the zero-DSP tests.

Device proof

The five zero-DSP tests passed on DN2; crash-capture passed on DT2. The bootscreen pair was reverted.

🤖 Generated with Claude Code

m-dwyer and others added 8 commits December 5, 2026 19:13
Adds the 2026-12-05 evidence refresh, two root causes (SHARC where it
isn't needed, graph edges wider than the code), the agreed order (7a)
and the SHARC link replay spike (7b).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
usb-bulk and usb-bulk-audio records now match their code. system-package-restart,
crash-capture, bootscreen-safe, bootscreen-fault and debug-observers load no module
with a DSP part and assert no audio or DSP state, so they drop the coupled SHARC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The selection code now returns why each device test was chosen (owner, record, imports, hub,
area, ports, named) as data, and what it left out (narrowed halves, dropped files). The device
command writes it as selection.json in its trace dir; the printed lines are unchanged.

- selection-record.mjs builds the record (halves with rule and trigger, skipped with reason,
  changed, dropped, lane, commit, base, level); full-tier runs record their scope only.
- gate-history --selection joins the record with slot wait and run time at read time and prints
  device-half minutes by rule plus the plan's headline numbers; older runs show as unrecorded.
- trace-rows.mjs is the one reader of slots-trace.json and nx-profile.json.
- The per-test reporter keeps the first error message of a failed test and writes a suite-error
  record for hook and collection failures, whose tests Vitest marks skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bootscreen-safe failed under dsp zero with 'empty startup requires a reusable
coupled session' (packages/test-support/src/session.ts:331 needs dsp 'sharc').
bootscreen-fault's halt error text also differs under zero.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
skippedHalves returns each skipped id with its reason and ranHalves gives the halves
that run, so selection-record.mjs only reshapes. A failed selection.json write prints
one line and the gate carries on. errorText cuts at 600 characters without splitting
a surrogate pair. The device-literals baseline takes the selection-record test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tem 7)

Records the SHARC link record spike (host commands land at wall-time points; the CF waits on
the SHARC in only 15-16% of frame time, yet zero mode runs 2-5x faster per test), the five
tests moved to zero DSP, and item 7 as agreed with c0 and db: device keys hash emulator
semantics, with an equivalence check on the SHARC implementation crates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The graph edges only decide what `nx affected` marks; device targets already depend on the
patchkit, daemon and image producers and key on their inputs, and the gate picks device halves
by ownership.

- module-dependencies: a project with device or conformance targets no longer gets implicit
  edges to digi-control, patchkit and devices (about 60 projects each). The record-module,
  conformance and nested-project edges stay.
- core/runtime: replace the dkrt-svc-* glob by the five service crates its Cargo dev-dependencies
  compile (rt, fx, lfo, rows, machines). The projects: inputs of rust-tests and test-assembly
  keep the glob, so the cache keys do not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Targets that run through nx affected need a real project edge to each project whose output
they read; dependsOn alone does not mark them affected.

- module-dependencies: a project with test-dsp or test-dsp-conformance keeps the patchkit and
  devices edges (the patchkit binary, the dsp fingerprint, devices/cycle-factors.json). Device
  and conformance device targets stay without them; digi-control stays dropped.
- core/runtime: restore the dkrt-svc-* glob, since test-assembly consumes every service pack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@m-dwyer

m-dwyer commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

The full gate (mise run test:all) passed (exit 0, nothing retried). Host step: 74 tasks, wall 20.4 min. Device step: 7 selected device halves plus the 17-half smoke set.

Selected (device step):

  • test:subset: 0 coupled and 7 zero-DSP tasks; core budget 12, 12 slots: 0 coupled and 7 zero-DSP start at once
  • usb-bulk-audio, usb-bulk, sdhc-large (DN2), debug-observers (DN2), system-package-restart (DT2 and DN2), crash-capture (DT2), gate-device-smoke: device (17 halves)

Skipped:

  • test:subset: skipped, selected by affected and left to the full tier: 212 device halves and conformance tasks of 50 projects
  • conformance: none selected

The only gate warning is the safety net (full daemon key) being 26 h old; it is not part of this change.

🤖 Generated with Claude Code

@m-dwyer
m-dwyer merged commit 7b6c4cd into main Dec 5, 2026
2 checks passed
@m-dwyer
m-dwyer deleted the tools/test-speed branch December 5, 2026 11:02
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