# Build status Written 2026-11-13 when the build session was stopped part-way. For whoever continues, with no memory of that session. Read [restart.md](restart.md) and [handoff-brief.md](handoff-brief.md) first; they bind you too. ## Commits of this session | Commit | What | |---|---| | `63aa192` | Provenance audit: `docs/provenance-audit.md`, `scripts/post_prose.py`, spec.md re-marked | | `2c47c44` | The core: `src/ym2612_python/` (`chip.py`, `operator.py`, `tables.py`, `variant.py`), pyproject, CI | | `335747d` | Tests for rungs 0, 1, 2, 4 and the provisional behaviours | | `21e5c1b` | Rung 6: Nuked-OPN2 pinned, `validation/nuked_harness.c`, `validation/closed_box.py` | | `293df36` | `validation/faults.py`; the tremolo depth test rewritten | ## Done and checked - **Provenance audit**, committed before any code. 76 posts read as prose with code boxes removed. Eight statements re-marked (A1 to A8 in provenance-audit.md): the operator tables' source (now S19 plus Nemesis's prose), the envelope step table, the attack formula, parts of SSG-EG, SSG-EG at key-off, the LFO counter while disabled, the vibrato table's lower columns, channel 3 mode 11. Two published values struck from validation.md rung 1. New unknowns U21 to U26. No value the core uses changed; their stated standing did. - **The core**, per-sample, both variants. Last run: `pytest -q` 186 passed; `ruff check .` "All checks passed!"; `ruff format --check .` "15 files already formatted" (PyPy 3.11, `.venv-pypy`). - **`validation/faults.py`**: 28 faults, 0 unnoticed, 1 min 40 s. Rung 0 notices 2, rung 1 19, rung 2 10, rung 4 12, provisional 8. (Run before the tremolo test was rewritten; not rerun since.) - **`validation/closed_box.py`** (about 10 s): 55 streams. Same writes to both: 9 streams identical, 276,578 of 388,113 channel samples equal. With operator 1's key bit given to the core one sample late (a harness alignment, see below): 12 identical, 361,827 equal. Status: 154 of 160 reads equal; BUSY set for 32 reads in both. Output in the git-ignored `validation/out/closed_box.txt`. ## Second session, 2026-11-13 - **Figures confirmed** by re-running: 186 tests pass (contract 12, measured 64, manuals 71, community 18, provisional 21); ruff 0.16.8 clean; `validation/faults.py` 28 of 28 caught in 69 s (rung 2 now notices 12, after the tremolo test rewrite); `closed_box.py` 9 and 12 of 55 identical, 276,578 and 361,827 of 388,113 equal, status 154 of 160; `--probes` as below. - **Written up**: docs/validation.md (status table; rung 6 results with a per-stream table, the probes, the nine differences), spec.md U27 to U29 (open items for differences 2, 3, 4), README.md, docs/claims.md, docs/api.md, docs/adoption.md. - **Not changed**: the core. Table 2 and probe 2 stay as they were, labelled, for the owner to judge (Slips 2); probe 2 is not counted as evidence. - Speed: about 9 times real time on PyPy with six channels sounding. ## The differences (written up in validation.md, rung 6) As observed from the detector's output only: 1. **Write timing (U1).** The model hears a key-on 4 samples after the core (operator 1: 5), a total-level write 2, 2, 2, 1 and a multiple write 3, 3, 3, 2 samples later, by operator (`--probes`). Explains most of table 1's differences and the few samples around every mid-note write. 2. **Accumulator.** With four carriers at different frequencies the model's peaks are lower than the core's clipped +255 (`channel-3-mode-01`, 107 of 1,223). Consistent with limiting after each addition in the order 1, 3, 2, 4. **Open**: the core sums, then limits. See "Slips". 3. **Phase restart.** At a CSM re-key over a sounding note and in SSG-EG patterns 0 and 4 the model's waveform is one sample later than the core's relative to the envelope. The core follows Nemesis's note that the phase generator "effectively outputs the phase increment value" with the counter held at 0. Open. 4. **CSM start.** In `csm-3f0` the model's first key-on comes about a timer period before the core's. Not characterised. Open. 5. **LFO (C14).** The model runs the shorter dividers. With the core's table swapped in the harness process, equal samples go 58 to 632 of 1,287, 234 to 1,547 of 1,671, 1,329 to 3,434 of 6,019; `vibrato-depth-5-rate-2` does not improve (C16 or step offset, not separated). Core left at the manual's. 6. **Envelope (U4, U3).** `envelope-fast` 244 of 6,118 differ in short runs at envelope steps; not characterised further. 7. **Ladder.** The model's slot is value + 4 or value − 3, as the core's (ymfm's) constants: observed, not fitted. A muted slot in the model is +4 or −4 by the channel's sign; the core's is +4 always. On the DAC channel a sign change between consecutive samples differs by 2 steps for one sample. 8. **BUSY** is not set on the model's read at the write's own clock (U10). 9. `feedback` 573 of 3,367, `rate-changes` 806 of 2,120, `mixed-3` channel 1 3,394 of 8,620 differ: not looked into. ## Not started - Rung 3 (recordings): nothing analysed. Rung 5 (ymfm run): no harness; it needs `ymfm_adpcm.*` and `ymfm_ssg.*` fetched and pinned at `81aec25`. - Streams that break Yamaha's waits. The ladder fit against Aly James's recording. - CPython 3.11 was not tried. ## Audit coverage Audited: every statement listed in provenance-audit.md's tables (sections 1 to 16). Not re-audited, on purpose, because the core does not use them: spec 2.6, 2.8, 2.9, 12.4, 17 except $2C bit 3. Manual citations from S1, S4, S5, S6 stand on Phase 0's reading; from S2 the audit checked the detune table, the F-number formula, the SSG-EG figure, the LFO rows and three figures by OCR. ## Not read, and why Every code box in thread 386; p16391, p29476, p29508, p30935, p30938, p31050, p32605, p34272, p34276, p34277, p34281, p34289 (relayed model code, or excluded authors); `reference/nuked-opn2/ym3438.c` (compiled only) and the state structure in its header (hidden when the header was read); `validation/build/cc.log`; `reference/scratch/notes-*.md` and `trash/`; megadrive-python's `src/` and worklog; Exodus; any Nuked file elsewhere. ## Slips and judgement calls 1. I tried to change the accumulator to limit after each addition, on the ground that it follows from a 9-bit accumulator, limiting, and the order 1, 3, 2, 4. The permission system refused it as a change made to follow the detector. The core is unchanged. Do not make it without the owner's ruling. 2. `closed_box.py` table 2 feeds the core operator 1's key bit one sample late, and probe 2 swaps the core's LFO divider table in the harness process. Both are harness-side and labelled; the owner may judge them too close to a stand-in. 3. The spec's first draft (read before the audit) states tables that came from Nemesis's code boxes; I had read them there. The core's values equal them. 4. ruff here applies more rules than the pyproject selects (source not found); it reordered `__slots__` alphabetically. 5. One inline rule in p8025's prose, and three lines of posters' arithmetic, passed the code filter (listed in provenance-audit.md). ## Next steps, in order 1. Done (second session). Was: `.venv-pypy/bin/python -m pytest -q`, `ruff check .`, `ruff format --check .`, `validation/faults.py`, `validation/closed_box.py` and `--probes`: confirm the figures above. 2. Done. 3. Done. Was: README.md (the known-and-how table; models run, code not read; S1 is leaked, cited not copied), docs/claims.md, docs/adoption.md, docs/api.md. 4. Done (U27, U28, U29). 5. If time: rung 5 (ymfm), rung 3.