Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ hashes are given where a change is easiest to understand by reading the commit.
out pale and scrambled) and its tabs are grey again, not red and green.
- VPro: the check mark of a checked menu toggle (IRIS GL pop-up menus, such
as powerflip's) draws as a check mark, not a black bar twice the box's width.
- VPro: text in X edit fields on a TrueColor desktop (nedit's file dialog,
any Motif text field) no longer loses the columns the text cursor has passed over.
- VPro: buttonfly's button labels draw as letters, not as pale boxes; large
LUMINANCE and INTENSITY textures are no longer stored as four 4-bit channels.
- Maximum IMPACT: every other screen row stayed black (PROM menus and
monitor, issue 777) in builds since 2026-11-17; both raster engines draw again.
- IMPACT (Indigo2 and Octane): texture colour tables
Expand Down
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ perfetto = []
# live either way. jit_go_count is load-bearing in tests: several JIT tests
# assert on it to prove they compared compiled code, not the interpreter.
rexdiag = []
# VPro texture packing check: records how each upload into board memory
# packed its texels and checks every texture level descriptor against the
# upload that wrote its memory; `vpro status` reports disagreements. A
# diagnostic with a small cost per upload and per texture bind, so off by
# default and independent of `developer`: `lightning,vprodiag` builds.
vprodiag = []
# Stale-code detector: verify, at execution time, that the instruction word an
# engine is about to run still matches what memory holds at that VA.
#
Expand Down
2 changes: 2 additions & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Select with `cargo build --release --features <comma-separated-list>`; add
| `r5ksc_triton` | Disabled O2/Triton integrated L2 model; deliberately refuses to compile. | `r5ksc` |
| `idle-pause` | Park the CPU in recognized guest idle loops; opt-in. | — |
| `tcache` | Keep cache tags/state but use authoritative ppmem RAM for cacheable data. | — |
| `vprodiag` | VPro texture packing check: each texture level is checked against the upload that wrote its memory, reported by `vpro status`. Off by default; small cost per upload. | — |
| `cache-ecc` | Cache parity/ECC injection and Cache Error exceptions for SGI IDE diagnostics; adds miss/exception checks. Off by default. | — |
| `decode-cache` | Compatibility flag; decoded-instruction caching for the shadow model is unconditional. | — |
| `tcache_verify` | Assert transparent-cache/RAM coherence on accesses; very slow. | `tcache` |
Expand Down Expand Up @@ -1016,6 +1017,7 @@ both the interpreter and jitv2.
| `developer_ip7` | CP0 Compare / timer delivery stats and debug prints |
| `developerx` | Break into the monitor on IBE/DBE/ADEL/ADES/TLB errors |
| `rexdiag` | REX3 per-GO activity bits and dispatch counters. **On by default**; drop with `--no-default-features` to measure their cost |
| `vprodiag` | VPro texture packing check (`vpro status`, "texture packing"): every texture level the guest names is checked against the upload that wrote that memory. Off by default; works with `lightning` |
| `gputrace` | REX3 annotated trace (`rex trace`) and replayable bus recording (`rex rec`); GR2, IMPACT, O2 and VPro annotated traces (`gr2 trace`, `mgras trace`, `re trace`, `vpro trace`); O2 engine recording (`re rec`). On with `developer`; opt in for plain and `lightning` builds |
| `llstats` | Per-address LL/SC reservation histogram (`ll stats`); lightning-compatible |
| `perfetto` | Record Perfetto traces for ui.perfetto.dev: per-thread event rings, a writer thread, host or guest timeline. See [docs/perfetto.md](docs/perfetto.md) |
Expand Down
11 changes: 11 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ in each. Both write to `/shared/results/TAG`; the host-side
`test/gltest/glsuite-compare.sh A B` lists every difference between two runs.
Running both on the CPU and the GPU raster unit and comparing is how the GPU
unit is checked against the reference end to end.

`test/gltest/texpack.sh` makes the library upload a texture every way glprim
can: each sized internal format and each unsized source format, small (FIFO
image) and 256x256 (DMA), with and without mipmap levels, plus ABGR, 16-bit
sources, a sub-image and `gluBuild2DMipmaps`. On VPro, in a build with
`--features vprodiag`, the board model checks
every texture level the library names against the upload that wrote that
memory, and `vpro status` shows the count and the first disagreements
("texture packing"). A texture packed one way and sampled another can round
trip through `glGetTexImage` unnoticed, so the texture sweep alone does not
catch it; run `texpack.sh` and read `vpro status` after it.
The same suite on a real board, from the same binaries, against a guest
emulating that board is how the model is checked against hardware; the
board's quirks then show up as differences instead of as failures. Cases
Expand Down
2 changes: 2 additions & 0 deletions clanker/INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ Odyssey (VPro V6/V8/V10/V12): the Octane2/Fuel/Tezro graphics board. Modelled on
| Note | Kind | Title |
|---|---|---|
| [pattern-shape-0-is-plane-anchored-32x32.md](odyssey/pattern-shape-0-is-plane-anchored-32x32.md) | rule | X pattern quads with shape 0 sample a 32x32 pattern at plane coordinates (MSB first); taken for "no pattern", menu check marks filled solid |
| [x-30-bit-save-under-is-write-code-0x10c.md](odyssey/x-30-bit-save-under-is-write-code-0x10c.md) | rule | the TrueColor save-under reads with packed write code 0x10c (ABGR 2_10_10_10_REV); looked up by low byte it was refused and text under the cursor vanished |
| [luminance-texture-uploads-keep-their-bytes.md](odyssey/luminance-texture-uploads-keep-their-bytes.md) | rule | L8 and LA8 textures uploaded by address (word 4 0x80001000, codes 0x42/0x48) keep their bytes, not 4/4/4/4; buttonfly glyphs drew as boxes. `vpro status` checks every level against the upload that wrote it; run test/gltest/texpack.sh |
| [write-pair-names-the-field-packing-not-the-pixel-mode.md](odyssey/write-pair-names-the-field-packing-not-the-pixel-mode.md) | rule | Copies and screen DMA puts pack the destination as word 7's write format/type says (COLOR_INDEX, RGBA/US_4_4_4_4), not as the selected pixel mode, which is often another window's: Icon Catalog scroll garbage and red/green tabs |
| [x-index-reads-by-address-return-the-field-byte.md](odyssey/x-index-reads-by-address-return-the-field-byte.md) | rule | The X server saves screen pixels with colour-index DMA reads of board memory by address (word 0 `0x2000`, format byte `0x41`); refusing them left black blocks where Motif text cursors had been. Answer with the field's byte |
| [gaps-found-by-the-2026-11-07-sweeps.md](odyssey/gaps-found-by-the-2026-11-07-sweeps.md) | open | Model gaps the full test sweep found on both raster units: CI8 reads return 0, X screen reads over some windows are noise, 10:10:10:2 pbuffers and 12-bit z16 visuals, double-buffered gltest shows only the clear |
Expand Down
43 changes: 43 additions & 0 deletions clanker/odyssey/luminance-texture-uploads-keep-their-bytes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Luminance and luminance-alpha texture uploads by address keep their bytes

Status: fixed 2026-11-21 (`dma_fields`); check added (`check_level_packing`, feature `vprodiag`, in `packing.rs`).

**Symptom.** buttonfly's button labels (a texture font) drew every glyph as
a pale opaque box with the letter faint inside it. glprim's 256x256
LUMINANCE and INTENSITY textures were stored the same wrong way (found by
the check below, not by eye).

**What the library sends.** A texture big enough to go by DMA is uploaded
into board memory with no level selected: word 4 `0x80001000` (2-byte
pixel and fields, format byte 0) and word 7 code `0x48` (LUMINANCE_ALPHA
bytes) or `0x42` (LUMINANCE bytes; INTENSITY is sent as luminance). The
draws then name the level as format index 0xb (luminance byte, alpha byte)
or 4 (one byte), `texel_storage`. buttonfly also builds mip levels 1-3 on
the board with `TEX_RECT` draws (`texture_build_level`); those were right.

**Cause.** With no level selected, `dma_fields` took the field's packing
from `copy::source_codec(2, 0)`: four 4-bit components. A clear texel
(L 0xff, A 0) was stored as 0xfff0 and sampled with alpha 0xf0.

**Rule.** A DMA upload to board memory by address with 2-byte fields
stores code 0x42 as `FIELD_ONE` and code 0x48 as `FIELD_TWO`. Other codes
keep `source_codec`; the copy path is unchanged (its tests send the same
word 4 for 2-byte id/overlay pairs). An ALPHA source by DMA was not seen
disagreeing; no rule for it.

**How to find the next one.** Every upload into board memory (DMA, FIFO
image into a scratch surface, board-built mip level) records its surface and
packing; each `TEX_LEVEL` descriptor over that memory is checked against it
once (`Board::check_level_packing`; build with `--features vprodiag`). `vpro status` shows "texture packing: N
levels checked ..., M disagree" and the distinct kinds of disagreement;
`log odyssey on` logs each. Run `test/gltest/texpack.sh` in the guest and
read the status. On 2026-11-21 it covered all 32 sized formats, the six
unsized source formats, both upload paths, mipmaps, ABGR, 16-bit sources,
sub-images and `gluBuild2DMipmaps`: only the luminance case disagreed.
A texture packed one way and sampled another can still round-trip through
`glGetTexImage`, which is why the texture sweep's `texread` missed these.

Tests: `tests/dma.rs` `a_luminance_alpha_texture_upload_keeps_its_alpha`,
`a_luminance_texture_upload_keeps_its_byte`,
`a_level_is_checked_against_the_upload_that_wrote_it`,
`an_eight_byte_level_over_lanes_is_the_same_packing`.
34 changes: 34 additions & 0 deletions clanker/odyssey/x-30-bit-save-under-is-write-code-0x10c.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# The 30-bit visual's save-under reads with write code 0x10c, a packed type

Status: fixed 2026-11-21 (`DMA_X_PACKED`, `dma_read_layout`).

**Symptom.** In a Motif text field on the TrueColor desktop (nedit's Save
As name field, any X edit field), characters the text cursor has passed over
lose the columns under it, so `/root/hello` turns into `/root/ŀ:ll:`.
The 8-bit login field (`x-index-reads-by-address-return-the-field-byte.md`)
was fine.

**What the X server sends** (`vpro trace` + `vpro rec`): the same three
steps as the index case, but the save is word 4 `0x82233062` (front, field
at unit 2, 4-byte fields) and word 7 `0xb301010c`. Its write code
(`write::CODE_MASK`, bits 8:0) is **0x10c**: format 0xc (ABGR), type 8,
ABGR 2_10_10_10_REV, four bytes a pixel. The restore puts the saved words
back with an image header of the same code (`0x0fa1110c`), burst tag 0x12.

**Cause.** `dma_read_layout` looked the code up by its low byte only
(`image::CODE_MASK`, 0x0c) in `DMA_X_LAYOUTS`, which has the byte codes
0x4c/0x4b/0x49/0x41. No match, the read was refused, and the X server's
buffer kept whatever it held before: in the recording every one of the 19
restores was the flat background word `0x11c4711c`.

**Rule.** An X read whose write code has bit 8 set is looked up by the whole
nine-bit code in `DMA_X_PACKED`, laid out as the write table
(`pixel_write.rs`) packs that code. 0x10c and 0x10b (RGBA 10_10_10_2) are
listed; add others when a trace shows them.

**How it was found.** Decode the restore's burst words straight out of the
`vpro rec` file (`W` records at offset 0x100000 after each `0x4570`
header): a restore that is all one value while the screen under the cursor
held text means the save, not the put, is wrong.

Test: `tests/dma.rs` `a_30_bit_save_under_returns_abgr_2_10_10_10_rev`.
2 changes: 1 addition & 1 deletion debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ guest. `y = 0` is the top display line throughout.

| Command | Description |
|---|---|
| `vpro [status]` | Board summary: identity, interrupts, swap bank, FIFO and raster queue levels, display frames, the scan-out mode and the video timing decoded from the guest's tables and clock part (totals, fields, blank lines, refresh rate), cursor, product and memory, drawing words and the pixel mode, primitive assembly, unmodelled reports |
| `vpro [status]` | Board summary: identity, interrupts, swap bank, FIFO and raster queue levels, display frames, the scan-out mode and the video timing decoded from the guest's tables and clock part (totals, fields, blank lines, refresh rate), cursor, product and memory, drawing words and the pixel mode, primitive assembly, unmodelled reports; with `--features vprodiag`, the texture packing check: how many texture levels were checked against the upload that wrote their memory, how many disagree, and the first few kinds of disagreement (level format, upload path, word 4 and code) |
| `vpro regs` | Host interface registers (no wait) and the widget's modelled registers: memory and flow-control config, FIFO set-up words, DMA and statistics addresses, BUZZ words, NIC, i2c, back-end index |
| `vpro fifo` | Command FIFO levels, raster queue, the command parser's state, the 2D stream, the open GL primitive, the image raster and query records |
| `vpro state` | The state a draw is made under: primitive assembly (open primitive, held vertices, colour and texture coordinate), the transform (matrices, viewport, depth range, user clip planes), the raster words decoded (cull, polygon modes and offset, line and point sizes, stipples, scissor, window), the shader and back-end state the stages run with, and the board's own drawing words (draw mask, dest, plane mask, colour mode, depth function, write mask, blend word) |
Expand Down
7 changes: 7 additions & 0 deletions src/dev/odyssey/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ pub(super) struct Reports {
pub dma_code_reported: bool,
/// One bit per dma::REPORT_* reason.
pub dma_read_reported: u32,
/// The texture packing check (Board::check_level_packing).
#[cfg(feature = "vprodiag")]
pub packing: super::packing::PackingCheck,
}

/// The vertex side's texture registers: the current texture coordinate
Expand Down Expand Up @@ -599,6 +602,8 @@ impl Default for Board {
dma_readback_reported: false,
dma_code_reported: false,
dma_read_reported: 0,
#[cfg(feature = "vprodiag")]
packing: Default::default(),
},
draw_mask: 0,
draw_word: 0,
Expand Down Expand Up @@ -970,6 +975,8 @@ impl Board {
self.tex.coord_r = 0;
self.tex.coord_q = ODSY_F32_ONE;
self.diag.tex_rect_reported = false;
#[cfg(feature = "vprodiag")]
self.diag.packing.uploads.clear();
self.stream.vertex_x.fill(0);
self.stream.vertex_y.fill(0);
self.stream.vertex_count = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/dev/odyssey/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ impl Board {
let at = (tag - reg::TEX_LEVEL) as usize * 3;
let op = self.cmd.operand;
self.tex_mut().levels[at..at + 3].copy_from_slice(&op[..3]);
#[cfg(feature = "vprodiag")]
self.check_level_packing(op[0], op[1]);
return;
}
if tag == gl_cmd::TEXCOORD_3F || tag == gl_cmd::TEXCOORD_4F {
Expand Down
14 changes: 14 additions & 0 deletions src/dev/odyssey/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,20 @@ impl Odyssey {
g.diag.reported_addr_count.load(std::sync::atomic::Ordering::Relaxed),
g.diag.reported_cmd_count
);
#[cfg(feature = "vprodiag")]
{
let p = &g.diag.packing;
let _ = writeln!(
out,
" texture packing: {} levels checked against the upload that wrote them, {} disagree",
p.checked, p.mismatch_count
);
for m in &p.mismatches {
let _ = writeln!(out, " {m}");
}
}
#[cfg(not(feature = "vprodiag"))]
let _ = writeln!(out, " texture packing: not checked (build with --features vprodiag)");
}
None => {
let _ = writeln!(out, " board busy: state not read (FIFO {} words, raster {} jobs)", fifo.queued_words(), raster.pending());
Expand Down
Loading