DirectStorage: count BCPack refusals per mode; opt-in solid fill to test what they cost #201
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!201
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/201/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Kalmarv on GitHub · 2026-11-23 20:32 UTC · original
Kalmarv:fix/dstorage-bcpack-refusals→main· +387 −14 · 2 files · 1 commits · closed without merging#195 reports that the retail menus' body text is missing most of its letters. Its one lead is the log line
DirectStorage: BCPack mode 7 unsupported, read as refusing one 64 KiB chunk. Onmain, that line can't say how many chunks were refused. Every BCPack refusal shares onewarn_once("BCPack", …)key, so the log shows the first refused request of any mode, and every later one fails silently withE_DECOMPRESSION. This PR makes the refusals visible and adds an opt-in experiment to test the lead. It doesn't decode BCPack, and without the switch every request behaves as onmain.Only
crates/xcl/src/hle/dstorage.rsandcrates/xcl/src/report.rschange (+387/−14). The tests are about 185 of those lines.Counts
BCPack BC7andBCPack BC7 after zlib. It gives the sizes and swizzle mode of the first such request, and says the request fails withE_DECOMPRESSION.request #klines:BCPack refusals so far: N requests: BC1 … (… bytes), BC7 … (… bytes).report.jsongetsdstorage.bcpack_refused, keyed byDSTORAGE_BCPACK_MODEname (BC1 … BC7, ormode Nfor values outside the GDK enum). It holdsrequests,with_zlib,destination_bytesandfilled_bytes. The field is#[serde(default)], like the other subsystem sections.Request::checkcalls in tests aren't counted.XCL_DSTORAGE_BCPACK_FILL=1(off by default; unset, empty or0means off)Each refused BCPack destination gets solid blocks of the requested BCn format instead of staying as it was:
A solid fill looks the same under any tiling or swizzle, so the layout doesn't matter.
It writes exactly
destination_sizebytes. The fill runs on the queue's worker, in queue order, where the request would have run. The destination is checked the same way as for a request that runs: committed, writable memory (writable), or the physical page array snapshotted at enqueue and written throughwrite_physical_pages. If the snapshot fails, nothing is written.The request still fails with
E_DECOMPRESSION, as before.How to use it with #195: run the menus with
XCL_DSTORAGE_BCPACK_FILL=1. If the body text turns into magenta boxes, the missing letters come from BCPack. If it doesn't change, the cause is elsewhere, for example indexed or shader-made rect lists, orXGTextureAddressComputer#10.bcpack_refusedinreport.jsonshows how many chunks and bytes are involved either way.Tests (
cargo test -p xcl --lib dstorage, MSVC debug, Windows 11; synthetic only)956a476bb66204)hle::dstoragetestsThe new tests:
bcpack_fill_blocks_are_solid_in_their_bcn_formatdecodes every fill block with small decoders in the test module (BC1, BC4/BC3 alpha, BC6H mode 11 UF16, BC7 mode 6). It checks all 16 texels of each block.bcpack_refusals_are_counted_per_mode_and_still_failchecks counts per mode, the zlib-combined count, destination bytes and the summary line. It also checks thatcheck()still returnsE_DECOMPRESSIONfor modes 1–7.a_refused_bcpack_request_is_filled_only_under_the_switchuses a memory queue and a BC7 destination of 0x1008 bytes (a partial block at the end) followed by guard bytes:E_DECOMPRESSION;Five mutations each fail one of the new tests: BC7 p-bits cleared, the fill ignoring the switch, a fill 16 bytes past the size, no zlib count, and the fill clearing the status.
cargo check -p xclis clean.Not covered:
write_physical_pagescode thatphysical_page_destinations_and_sourcescovers.AI-assisted (Claude Code). No game data.
🤖 Generated with Claude Code
@Kalmarv on GitHub · 2026-11-23 21:04 UTC · original
Rebased on main
eaa36b6(a486652, no conflicts).cargo test --release -p xcl --lib dstorage: 12 passed. Main'swritable()now accepts the UMA committed window as well, which the fill path uses.Overlaps: #208 is stacked on this commit (the BCPack decoder; its refusal counts are this PR's). #167 also edits
hle/dstorage.rs(the refused factory IID in the log); the two merge without conflicts.@Kalmarv on GitHub · 2026-11-23 21:06 UTC · original
Correction to this PR's motivation: #211 found the cause of the missing menu letters, and it isn't BCPack. The glyph caches are small render targets the title fills from the CPU, which
title_textures::registernever uploaded; with #211 the body text is complete.What still stands: main refuses every DirectStorage request with a BCPack stage, and nothing shows how many. Whether a refused request loses anything visible in this title isn't known. The per-mode counts in
report.jsonwould show how much is refused in a run.AI-assisted (Claude Code).
@ivall on GitHub · 2026-11-23 21:10 UTC · original
Merged into main (
6da33fa) asbb66204c, the head before your last rebase - the same patch (identical patch-id), so GitHub does not show it as merged; closing it by hand. Checked on an RX 9070 (RDNA4) with the 22 PRs merged together: 582 unit tests passed, 0 failed, the integration and e2e tests passed, and the retail game still reaches its first menu (646 frames in 30 s, no device removal). Thanks!Pull request closed