Repository navigation
rad1: audit the register model against its contract, name the offsets, fix two mismatches - #676
Open
jamesbraid wants to merge 2 commits into
Open
jamesbraid wants to merge 2 commits into
jamesbraid wants to merge 2 commits into
Conversation
jamesbraid
force-pushed
the
audio/rad1-audit
branch
from
November 12, 2026 09:44
74a79b5 to
4cc1a70
Compare
jamesbraid
force-pushed
the
audio/rad1-audit
branch
from
November 12, 2026 14:45
4cc1a70 to
0b4830b
Compare
The RAD1 model matched bare offsets in the start-up register list, the descriptor rings, the position bank, the status-slot layout, the counter control words and the control words it accepts to start a channel. A reader could not tell a register from an arbitrary number, and a later generated definitions header would have had nothing to replace one for one. The offsets, fixed words and slot layout now live in rad1/regs.rs, named for what the register does. Registers whose meaning no source gives are named by their offset and marked unsourced, and the module notes say so instead of leaving the guess implicit: the counter's hold, run and stop reading of 0x0e, 0x0a and 0x02 is the model's, as is taking run only after hold. No behaviour changes; the module's tests pass unchanged.
Audit of the RAD1 model against its register contract found two registers whose behaviour did not follow it. The MediaIO start-up writes 0x84 with 0. The model had no such register and dropped the write as an unsupported access. It now stores and reads it back like the other start-up words, so a guest's start-up no longer trips the unsupported-access log. The MediaIO driver never writes the counter control word at 0x40, yet at start-up reads the counter at 0x30 twice 10 us apart and raises "RAD UST not incrementing" unless it advanced by 3. The model's counter ran only after the Octane's 0x0e, 0x0a control writes, so on the Onyx2 it never moved. The MediaIO card's counter now runs from reset and a card reset does not stop it; the Octane's still waits for its control words. This is the contract's reading, not a run: I did not boot the Onyx2 to see the alert go. The new tests fail on the old model: a nonzero write to 0x84 read back as 0, and the MediaIO counter did not advance with no control write.
jamesbraid
force-pushed
the
audio/rad1-audit
branch
from
November 12, 2026 14:49
0b4830b to
a4ace6c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The RAD1 model gave a meaning to 0x88 and 0x8c that no source supported (the Onyx2 muted every other second because of it). That bug was found by a guest, not by reading the register contract. This PR reads the whole model against the contract register by register, so the next one is found on paper.
Two commits:
rad1/regs.rs, named for what the register does. A register no source explains is named by offset and marked unsourced. No behaviour change.Audit result
Counts over the registers and fields the model reads, writes or acts on: 27 match, 2 fixed, 8 unsourced (kept, flagged in the module notes and the
REG_UNSOURCED_*names).Scrutinise
regs.rsequals the old inline one, andSTARTUP_OFFSETSkeeps its order (0x84 is appended in commit 2, last).startuplist by one; saves are for identical builds.Verification
cargo check --tests -p iris, default and--features jitv2.cargo test -p iris --lib rad1: 70 passed. Touched module list from the diff:dev::rad1only.