Skip to content

BCPack: read and test the BC7 dictionary entry layout - #856

Closed
ettehn wants to merge 1 commit into
xcl-dev:mainfrom
ettehn:bc7-dictionary-layout
Closed

ettehn wants to merge 1 commit into
xcl-dev:mainfrom
ettehn:bc7-dictionary-layout

Conversation

@ettehn

@ettehn ettehn commented Nov 24, 2026 •

Copy link
Copy Markdown

Part of #832.

What is in it
A test-only Rust reader for 116-byte BC7 dictionary entries, based on the public format description in Marvisak/VIctory#658. It preserves bytes 52–53 and reads the two signed index arrays (16 and 15 elements). Four synthetic tests cover consecutive records, signed values, truncated input, zero-width sets and the pixel-0 anchor. The module is compiled under #[cfg(test)].

Tested
Windows 11 x64 25H2 (26200.9974), Ryzen 9 8945HX, RTX 5070 Ti Laptop (621.24), rustc 1.97.1, MSVC debug, commit b8a791e. cargo build --workspace passed. cargo test --workspace -- --test-threads=4: 717 passed, 0 failed, 41 ignored. All four new tests passed. Two tests included in the pass count reported SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.

Regression run
Retail smoke runs supplied by @Anon64 on an RTX 3060 (driver 581.80), 60 seconds each. Original report.

main:

xcl-smoke v1
commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1636 (PresentX 1637)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18113 MB

PR:

xcl-smoke v1
commit: b8a791e3c7d284e38f6d5cbe44fa467d965174b4
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1631 (PresentX 1631)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 17627 MB

Not tested
No retail game was run on my machine. The reader was tested with synthetic dictionary records only. DirectStorage integration and end-to-end BC7 decompression are outside this change.

AI use
OpenAI Codex (GPT-6.2 Astra) assisted with implementation, tests and the PR description.

Assisted-by: OpenAI Codex (GPT-6.2 Astra)
@Anon64

Anon64 commented Nov 24, 2026

Copy link
Copy Markdown

Regression runs for this PR's head b8a791e and for its base main beaa245, on a retail title (same title, 60 s each), made with scripts/smoke.ps1 (release, clean tree at each commit) and pasted unedited, for Regression run.

main:

xcl-smoke v1
commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1636 (PresentX 1637)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18113 MB

this PR:

xcl-smoke v1
commit: b8a791e3c7d284e38f6d5cbe44fa467d965174b4
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1631 (PresentX 1631)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 17627 MB

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 581.80, wave32), Intel Core i9-14900KF, Windows 11 25H2 26200.9974 (native Windows), Rust 1.90.0

Not tested

  • the unit tests on this machine
  • whether the title reaches the changed code; this is a regression check only

Report written with Claude Code (Claude Opus 5.5) from runs on this machine.

@dcastell1

Copy link
Copy Markdown

Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, applied on main@beaa245:

patch -p1 < this PR            # clean, no fuzz
cargo test --workspace -- --test-threads=4
741 passed; 0 failed; 41 ignored   (exit 0)

Four more passing tests than main on this box (737), so the BC7 dictionary entry reader and its tests run green here; nothing else changes verdict. No game data — the dictionary fixtures are synthetic.

AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.

phantomic12 pushed a commit to phantomic12/xcl that referenced this pull request Nov 24, 2026
…ree surveys

The harness reads d3d12.last_frame_dump from report.json (sampled_pixels / non_dark_samples)
instead of parsing BMPs - that is the number XCL already computes, and it is what issue ivall#717
proposes to put in the smoke block. -MinLitPct (default 1) fails a run whose last frame is dark,
so a black screen cannot be reported as a pass.

Surveys committed (docs/):
- bcpack-decoder-plan.md: BCPack is already staked out upstream by ivall#888/ivall#856/ivall#832, and no public
  bit layout exists - the seam is definable but every stream detail is 'unknown - needs a sample'.
- upstream-scan.md: 17 PRs and 25 issues touch this area; the smoke block format is
  maintainer-owned (ivall#834/ivall#835/ivall#717) and our summary.md is not an xcl-smoke v1 block.
- trap-695-not-reproduced.md: issue ivall#695's int3 at +0x4dcbc9d does not happen on this AMD RDNA2
  machine over 6 consecutive 120 s runs, with the same shader and PSO refusals - a data point for
  that issue.

Windows PowerShell 5.1's Get-Content -Raw mangles the en-dash in the 'backend' line, so the GPU
name is read with [IO.File]::ReadAllText.
@SlopTart

Copy link
Copy Markdown

Linux / AMD RDNA3 datapoint.

Merged state: head b8a791e onto main 1ec4c98, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 709 passed, 10 failed, 41 ignored. Failures = the known Wine-lane set from my #42 rows plus #718 trio members and a hit of gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes (new flake, see #718 addendum). BC7 dictionary entry layout tests green.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

@ivall

ivall commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

#905 is merged (67a3735): DirectStorage now unpacks BCPack BC1, BC3, BC4, BC5, BC6H and BC7 with the format's exact tables, so this PR is superseded. Thanks – the BC7 dictionary layout of VIctory #658 is what #905 reads, and bc7_dictionary_indices_line_up holds the shipped table to it (zero-width sets, pixel-0 anchor).

@ivall ivall closed this Nov 24, 2026
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.

5 participants