Files
retroDE_ps2/docs/ch429_psmt4_character_closeout.md
thejayman77 ba74bbd5aa Snapshot: fog implementation + fidelity tooling baseline (pre bilinear-clamp fix)
Per-vertex GS fog end-to-end (gs_stub emit incl. persp_emit5, gs_prim_list_feeder
XYZ2->XYZF2 on PRIM.FGE, gs_make_sh3_scheduler_fixture.py F/FGE packing), new fog
TBs, fidelity attribution tooling. Functional baseline before removing the dead
bilinear lerp8 clamps (Codex: 161-node comb loop -> -0.042ns setup fail).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 19:56:46 -04:00

81 lines
3.7 KiB
Markdown

# Ch429 — native PSMT4 character recovery
## Objective
Recover visible captured geometry that was still absent from the accepted
Ch428 frame, while preserving authentic draw order and refusing additions
that merely increase epoch count or worsen the presentation.
## Deferred PSMT4 postprocess
`zsrt139f34` appended the existing 18-epoch tiled PSMT4 overlay after the
Ch428 frame, in its authentic late-frame position. Its 295-epoch production
RTL replay passed every structural gate and produced framebuffer SHA-256
`7b167db3927c6e765c464d0e8ddbfb37f23d5b980d87ebdfc9af97b20128e044`.
The replay also established that the captured overlay is a real contrast
operation, not an opaque texture: its alpha equation is
`(Cd-Cs)*0xdc/128 + Cs` with COLCLAMP enabled and source RGB values of 0 or
24. Applied to the still-underlit reconstructed base, it crushes most of the
scene to black and worsens the mapped PCSX2 score to MAE 24.0034 / RMSE
32.9396. The overlay is therefore deferred until the missing illumination
and base-color population is present; f34 was not deployed.
## Native 512x1024 PSMT4 support
A separate captured family of 19 opaque PSMT4 triangle strips covers the
foreground character body at draw indices 165536 through 172233. The draws
share TBP 9216, TBW 8, a logical 512x1024 texture, and several authentic CLUT
banks.
The coverage planner now accepts explicit PSMT4 selection. The fixture
generator reconstructs the canonical GS-swizzled 512x1024 PSMT4 local-memory
image, packs its nibbles into the fixed 262,144-byte texture cache, preserves
PSM/TBW/TW/TH in TEX0, and samples packed nibbles in the independent software
reference. Fast-fit scaling now uses the logical texture dimensions.
Generation is fail-closed. An independent host check confirmed that all
262,144 emitted texture bytes exactly match the local-memory reconstruction;
the emitted TEX0 decodes to TBP 1024, TBW 8, PSM `0x14`, TW 9, TH 10. The
texture CRC is `0x9ecc08f5`.
## Accepted f36 result
`zsrt139f35` groups the 19 strips into 13 exact-state/asset epochs.
`zsrt139f36` inserts those epochs at their authentic position before the
final opaque draws, CT32 darken, and complete alpha family. The resulting
frame has 290 epochs.
Production RTL replay passed with:
- 1,331,626 fragments fed and 1,311,991 passed;
- 290 markers and drains;
- zero fragment drops, color overflows, and AXI errors;
- Z mismatch 0/307,200 and color mismatch 0/245,437;
- framebuffer SHA-256
`102bf7925b859bcacc91172ecdcd1755b4f01210f327ac918a1c8d7954905d2b`.
Relative to Ch428, the recovered family changes 3,099 source pixels within
`(319,242)..(361,479)` and restores the visible foreground character-body
silhouette. On the mapped changed-pixel support its RMSE improves from 15.10
to 12.82. Whole-frame mapped RMSE improves from 27.6458 to 27.6303, while
MAE moves narrowly from 18.9378 to 18.9407. This is accepted as authentic
structural fidelity with a mixed scalar-score result, not described as a
broad color-fidelity win.
## Silicon acceptance
No new compile or RBF was required; the timing-clean Ch423 image remained
loaded. The DE25 completed all 290 epochs with every texture CRC, palette
checksum, staged-record count, ordered drain, and zero-drop gate passing.
The scheduler returned `rc=0`, selected the HDMI line-buffer source, and
reported 212,673 nonzero pixels, bounds `(0,0)..(511,479)`, sum32
`0x00e0b761`, and xor32 `0x9622a8a3`.
The board and production RTL framebuffer files are byte-identical at the
SHA-256 above. The mapped board score is MAE 18.9407 / RMSE 27.6303, and the
accepted board image is preserved as
`captures/gs/silenthill3/extracted/sh3_zsrt139f36_ch429_board.png`.
Ch429 is accepted on silicon and f36 is the current live HDMI baseline.