Skip to content

docs(ledger): record the provisional CI4 probe result and the tlut_en gap - #181

Merged
doublegate merged 2 commits into
mainfrom
docs/ci4-eliminated
Jul 29, 2026
Merged

docs(ledger): record the provisional CI4 probe result and the tlut_en gap#181
doublegate merged 2 commits into
mainfrom
docs/ci4-eliminated

Conversation

@doublegate

Copy link
Copy Markdown
Owner

The probe ran, and it eliminates the suspect

The previous entry named a CI4-with-TLUT vector as the next probe. It has been run.

A vector was authored — eight CI4 indices 0..7 against eight distinct,
non-zero
palette entries — and replayed through RustyN64:

ours:  f801 07c1 003f ffff ffc1 07ff
       red  green blue white yellow cyan     ← exactly the authored TLUT

RustyN64 resolves the full palette correctly. The colour-indexed fetch works
in isolation and is not what turns Ocarina black.

Why the vector is deliberately NOT committed

Angrylion rendered mostly 0x0001 from the same command list:

golden: f801 0001 0001 0001 07c1 0001

That is a near-empty palette — which means my Load Tlut encoding is wrong,
not that our decoder is. Angrylion faithfully executed the command list I wrote;
we were simply more permissive about where the entries came from.

Committing that golden would pin an authoring error as the spec, which is the
one thing a test-as-spec project must not do. The next probe has to verify the
Load Tlut encoding against N64brew …/Commands before any golden is trusted.

A separate real defect, found along the way

Other Modes.en_tlut (command bit 47) is not decoded at all. Our TLUT lookup
is driven purely by the tile's format field, so:

  • a CI tile with en_tlut clear still gets a palette lookup (it should not), and
  • a non-CI tile with en_tlut set does not (on hardware it should).

Wrong in both directions, and independent of R-18. Recorded rather than fixed here
— fixing it needs its own vector, and the Load Tlut encoding has to be settled
first so that vector is trustworthy.

Net effect on R-18

The black frame is narrowed to the texture path but no longer to the CI4
decoder
. That is a smaller claim than the previous entry made, and it is the
honest one.

Gates

cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings,
cargo test --workspace (38 RDP conformance vectors still green), pre-commit run markdownlint --all-files — each run separately, exit status checked.

Oracle: docs-only, no emulation behaviour change, so n64-systemtest is
unchanged at 90 suite-wide, Phase 1 Failed: 0, per docs/STATUS.md.

🤖 Generated with Claude Code

Ran the probe the previous entry named. It eliminates the CI4 decoder as the
cause of R-18's black frame, and turns up a separate real defect.

A CI4-with-TLUT vector was authored - eight indices 0..7 against eight distinct
non-zero palette entries - and replayed. RustyN64 resolves the full palette
correctly: f801 07c1 003f ffff ffc1 07ff, i.e. red, green, blue, white, yellow,
cyan, exactly the authored TLUT. So the colour-indexed fetch works in isolation
and is not what turns Ocarina black.

The vector is deliberately NOT committed. Angrylion rendered mostly 0x0001 from
the same command list, which means the authored Load Tlut encoding is wrong -
Angrylion loaded a near-empty palette and we were more permissive about where the
entries came from. Committing that golden would pin my authoring error as the
spec, which is the one thing a test-as-spec project must not do. The next probe
has to verify the Load Tlut encoding against N64brew before any golden is
trusted.

Separately, and independent of R-18: Other Modes.en_tlut (command bit 47) is not
decoded at all. Our TLUT lookup is driven purely by the tile's format field, so a
CI tile with en_tlut clear still gets a palette lookup and a non-CI tile with it
set does not - wrong in both directions.

So the black frame is narrowed to the texture path but NOT to the CI4 decoder.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@doublegate, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0f24e1bc-aa31-403c-b2a2-2b7ae77c2ff0

📥 Commits

Reviewing files that changed from the base of the PR and between 5407e59 and d595bfe.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • docs/accuracy-ledger.md
📝 Walkthrough

Walkthrough

R-18 documentation now records the corrected IPL3 boot root cause, revises “lit pixels” evidence, and narrows the remaining black-frame diagnosis to CI4/TLUT handling, including undecoded en_tlut and unverified Load Tlut encoding.

Changes

R-18 accuracy diagnosis

Layer / File(s) Summary
Boot and CI4/TLUT diagnosis
docs/accuracy-ledger.md, CHANGELOG.md
R-18 is marked substantially resolved after correcting sp seeding; the remaining black-frame hypothesis focuses on CI4/TLUT texel resolution, missing en_tlut decoding, and Load Tlut encoding verification.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 8 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Measured, Never Tuned ⚠️ Warning FAIL: CHANGELOG.md adds Other Modes.en_tlut as command bit 47 with no manual/wiki citation, and the R-18 ledger update records it without measurement provenance. Add a citation to the N64brew Commands page for en_tlut, or move the claim into docs/accuracy-ledger.md with the probe/measurement details that establish it.
Title check ⚠️ Warning The title matches the change, but it exceeds the 72-character Conventional Commits limit. Trim the subject to 72 characters or fewer, for example: 'docs(ledger): record CI4 probe result and tlut_en gap'.
✅ Passed checks (8 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Oracle Number Is Stated ✅ Passed Pass: docs-only change explicitly states n64-systemtest is unchanged at 90, matching docs/STATUS.md's current count; the oracle-number rule is satisfied.
Docs-As-Spec Sync ✅ Passed Only CHANGELOG.md and docs/accuracy-ledger.md changed; the PR body says docs-only, no emulation behaviour change, so the docs/.md rule is not triggered.
Changelog Entry For User-Visible Changes ✅ Passed CHANGELOG.md has an [Unreleased] entry for the R-18 user-visible fix, so the rule is satisfied.
Unsafe Stays Out Of The Chip Crates ✅ Passed PASS: HEAD only touches docs; rustyn64-core and all chip crates still have #![forbid(unsafe_code)], and repo-wide Rust scans found no unsafe syntax, including frontend.
Description check ✅ Passed The description directly matches the CI4/TLUT probe and en_tlut gap recorded in the diff.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/accuracy-ledger.md`:
- Line 413: Keep the CI4/TLUT findings explicitly provisional in the R-18 entry:
retain that the isolated decoder probe is not evidence of the correct Load Tlut
encoding, and state that N64brew Load Tlut and Other Modes.en_tlut citations
must be verified before treating the behavior as settled. Apply the same
qualification to the corresponding CHANGELOG entry at CHANGELOG.md lines 37-47;
do not present CI4 or en_tlut behavior as confirmed hardware semantics.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bb0cba60-cd3e-4af0-a0d2-c52b06412ed3

📥 Commits

Reviewing files that changed from the base of the PR and between cb1f06c and 5407e59.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • docs/accuracy-ledger.md

Comment thread docs/accuracy-ledger.md Outdated
@doublegate doublegate changed the title docs(ledger): the CI4 decoder is eliminated; en_tlut is undecoded docs(ledger): record the provisional CI4 probe result and the tlut_en gap Jul 29, 2026
Review follow-up, all three findings adopted.

The CI4 result is now recorded as provisional rather than as an elimination. The
reviewer's point is sharper than my framing: because the authored Load Tlut
encoding was wrong, our decoder was reading TMEM that a CORRECT load would not
have produced. So the probe shows the index-to-palette mapping resolves against
whatever we loaded - which makes a totally-dead decoder unlikely - but it does
not establish the load path. CI4 is weakly de-prioritised, not eliminated, and
the entry says so.

The bit-position claim now carries its citation, and the field carries the
wiki's own name. It is tlut_en, not en_tlut: N64brew Reality Display
Processor/Commands 0x2F, bit 47, "tlut_en: Enables Texture Look-Up Table (TLUT)
sampling", with tlut_type at bit 46 selecting RGBA16 vs IA16. I had asserted the
position from memory; it happened to be right, which is not the same as having
checked.

PR title rewritten imperative per conventional commits.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@doublegate

Copy link
Copy Markdown
Owner Author

Measured, Never Tuned — ADOPTED, and it caught a real lapse. I asserted en_tlut is "command bit 47" from memory, with no citation, in a project whose whole rule is that undocumented values are measured or cited, never recalled.

Checked it. The position was right; the name was not, and "happened to be right" is not the same as "verified":

N64brew Reality Display Processor/Commands §0x2F, bit 47"tlut_en: Enables Texture Look-Up Table (TLUT) sampling. Texels are first fetched from low TMEM that are then used to index a palette in high TMEM to find the final color values.", with tlut_type at bit 46 selecting RGBA16 (0) vs IA16 (1).

The field is now called tlut_en — the wiki's own name — and both the ledger and CHANGELOG carry the citation. Renaming matters beyond pedantry: a reader grepping the wiki for en_tlut finds nothing.

Title check — ADOPTED. Retitled imperative: "record the provisional CI4 probe result and the tlut_en gap", which also now describes what the PR concluded rather than the stronger claim it originally made.

@github-actions

Copy link
Copy Markdown

Antigravity review (Gemini via Ultra)

This PR updates CHANGELOG.md and docs/accuracy-ledger.md (row R-18) to record provisional results from an uncommitted CI4 texture probe and log a newly identified defect where Set Other Modes.tlut_en is not decoded.

Blocking issues

None found.

Suggestions

  • CHANGELOG.md:L37-L49: Avoid copying raw diagnostic narratives and probe output (f801 07c1...) directly into the changelog. Summarize the high-level takeaway in CHANGELOG.md and delegate the detailed investigative trace to docs/accuracy-ledger.md (row R-18) to keep release notes concise and maintainable.

Nitpicks

  • docs/accuracy-ledger.md:L413: Storing multi-paragraph investigation history inside a single Markdown table cell degrades readability and leads to unwieldy git diffs.
  • CHANGELOG.md:L45 / docs/accuracy-ledger.md:L413: Specify the 32-bit word indexing alongside 64-bit bit positions (e.g. bit 47 in command word 0 vs word 1) for tlut_en to prevent ambiguity against command parser implementations.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

@doublegate

Copy link
Copy Markdown
Owner Author

Both remaining pre-merge warnings are stale: CodeRabbit last reviewed at 08:57:10Z and the fixes landed at 09:04Z. Verifiable on the branch — the title is now imperative ("record the provisional CI4 probe result and the tlut_en gap"), and tlut_en carries its citation to N64brew …/Commands §0x2F bit 47 in both the ledger and the CHANGELOG. The inline CI4-provisionality finding is addressed and resolved.

Merging on that basis. CI 9/9, all threads resolved, no outside-diff findings.

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