Skip to content

Improvement: keep each DSP core's peak and three readings a state in device:price - #2104

Draft
repeat98 wants to merge 2 commits into
mainfrom
tooling/price-peaks-repeats
Draft

repeat98 wants to merge 2 commits into
mainfrom
tooling/price-peaks-repeats

Conversation

@repeat98

@repeat98 repeat98 commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner
  • What was wrong or hard: npm run device:price parsed each stats line's per-core mean/peak pairs (scripts/device.mjs prints both) with T1-4 (\d+)\/\d+ and threw the peak away, so evidence/cpu-price.json kept only means while DSP admission has to hold the worst block. Each state (before, at rest, in use) was also one 8-second reading, so a record could not say how far its own figure would move on a second try (two readings of one scene differ by about ±2.5 points of the longest frame, REST_NOISE).
  • What this changes:
    • reading() keeps each core's peak (dsp1to4Peak, dsp5to8Peak: the busiest frame of the last 1,024-frame window, highest of the window's samples) beside the means. The meter is now sampled about once a second (at least three times) instead of three times a window, so a peak has more windows to land in.
    • Each of the three states is --readings readings (default 3, 1 to 9). combined() keeps the means averaged, the longest frame and the DSP peaks as the highest any reading saw, frames summed, the guard's skip count and the allocation from the last reading, and from two readings on readings and a spread per figure (highest less lowest). added() adds the peaks to atRestAdds/inUseAdds where both sides have one. The curve, admission runs and --stock still take one reading a point.
    • --key-bus live|silent records what the key bus carried in the record's inputs (with transport: playing, which device:price always reads), so a later comparison can tell a fed key bus from a silent one.
    • The record gains readings and inputs at the top; the price's conditions sentence says "3 readings of 8 s a state". --write's price is unchanged: still the frame interrupt's mean share (owner, 17 November), now averaged over three readings.
    • Readers: every new field is optional, so the 29 committed cpu-price.json records load as before (the "holds on main" tests over them pass). module:doctor's cpu price line names the readings and the widest spread of a record that has them (readingsNote). The site reads only the means, which keep their meaning; cycle-scan unit reads the peak in its own pull request.
    • Docs: the test procedure's step 9 and its "What a release measures" table name the readings and the new fields. Changelog entry.
  • How I checked it: scripts/octatrack-price.test.mjs (16 tests; new: peaks parsed, a reading from before the peaks adds no peak, three readings combined with their spread, the inputs, writePrice with readings and inputs) and scripts/module-cpu-price.test.mjs (24 tests; new: readingsNote and the doctor line, nothing for an old record) pass. npm run pr:ready on 2ff7fcf (main merged in): every stage passed, including the 131 affected Vitest files, modules:check, sdk:check (665 cases) and the build.
  • Tested on a unit: not tested on a unit: the unit was held by another session's test procedure until 13:22 today, so no live reading proves the new fields yet. The tool's unit steps (PLAY, guard, stats, STOP) are unchanged apart from the count and the sampling interval; the first device:price run on a twin will write the first record with peaks and spread.
  • Edge cases: none, because this changes no built package or base: it changes a host tool and what its record holds.
  • What the guides lacked or got wrong, and where I fixed it: docs/TEST_PROCEDURE.md described one 8-s reading and only the DSP means; fixed there. docs/OCTATRACK_DRIVING.md is over 40 KB, so its device:price row stays as it is (it names no reading count).

🤖 Generated with Claude Code

repeat98 and others added 2 commits November 24, 2026 10:49
The price tool parsed the stats line's mean/peak pairs and kept only the
means, from one 8-second reading per state. It now keeps each core's peak,
takes three readings of the before, at-rest and in-use states by default
(--readings), and records how far they spread. --key-bus live|silent
records what the key bus carried. All new fields are optional, so older
cpu-price.json records load unchanged; module:doctor names the spread.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant