Repository navigation
Conversation
|
@Cattn your run of 🤖 Claude Opus 5.5 |
… BC1 requests are unpacked Their work, merged as it is. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Test report for #273 at Setup: AMD Radeon RX 9070 (16 GB; XCL's report.json: "AMD Radeon RX 9070 (16191 MiB VRAM)"), Ryzen 7 7800X3D, 31.2 GB RAM, Windows 11 Pro 10.0.26300, DXC 1.8.2502.11, rustc 1.98.1 (48a229cea 2026-09-01), release build for the runs, debug for the tests. Retail title 1.0.2.1, Regression run (
Frames 1503 vs 1505 (99.9 %), peak commit 14883 vs 14902 MB, no device removal, no crash. An earlier pair of runs with inputs gave 1194 ( BC1 effect, scripted menus (
Tests on 5f12643 ( |
|
@ExMoha thank you: the first run where this decoder is actually called. Both blocks are in the description under Regression run, and the BC1 and DirectStorage numbers under Tested. 🤖 Claude Opus 5.5 |
|
@ivall, for the provenance question you raised on #340: the facts on this PR's two BC1 tables, with no argument about whether they are acceptable. Sources: bcpack-rs at 1. How bcpack-rs made them
2. The same for every stream and title?
3. Another route to the same constants
4. What #208 needs
What we can do
Not checked: bcpack-rs's fits were not rerun (that needs game files; we have none), so both projects' statements are quoted, not verified. Whether they measured the same title. 🤖 Claude Fable 5.2 |
|
Test report: Intel before Ice Lake + AMD RDNA2, a hardware pair not in the list above, on the same retail title. Tested
BC1 on a retail run.
The log has This PR's head on its own is far behind
Not tested
AI use
|
|
Retail run of #273 on NVIDIA, into world loading, with a run of Setup
Results (
Not tested
Test report written with Claude Code (Claude Opus 5.5) from runs on the hardware above. |
|
Thanks, @0klavair. The one failure is the history entry the tables don't have. The description lists it under "Known to be approximate or assumed": "One history entry (slot 4) was never seen and is not known. A block that refers to it fails the request." Your message is that case: symbol 7 in the first block refers to entry 4. A synthetic stream built the same way gives exactly that error with the shipped tables, and the neighbouring entries 3 and 5 unpack. The request fails with 🤖 Claude Fable 5.2 |
The rANS lanes a BCPack stream is split into, for BC1, BC3, BC4, BC5, BC6H and BC7: a port of the decoder module of Microsoft's silicon-rans sample (MIT), with the byte feeder and symbol release after the format notes of bcpack-decoder and bcpack-rs (MIT, no code taken). The 128 static models are generated by scripts/gen_bcpack_tables.py from the sample. Nothing calls it yet; DirectStorage still refuses BCPack requests. Tested against fixtures from an encoder written independently from the notes (tests/data/bcpack/generate.py) and a round-trip encoder. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
BC1 blocks are rebuilt from the 12 lanes of the entropy stage (bc1.rs, after the BC1 sections of the bcpack-decoder and bcpack-rs format notes, MIT, no code taken). The rebuild needs two tables of constants that no stream carries: the 255 endpoint sets a stream starts with and the order of the 256 selector quadrants. bcpack-rs by Ahmet Dedeler (https://github.com/Ahmet-Dedeler/bcpack-rs, MIT) estimated both from retail data; bc1_fitted.rs is generated from its data files by scripts/gen_bcpack_bc1_tables.py and carries its MIT notice. The constants belong to the codec, not to a game. dstorage.rs runs the BCPack stage for BC1, alone or after zlib; every other mode is refused and counted as before. A stream the decoder does not take fails the request with E_DECOMPRESSION and writes nothing. report.json gets dstorage.bcpack_unpacked per mode (requests, bytes rebuilt, failed). The output is an approximation where an estimate is off: one history entry is not known (a block that refers to it fails the request), 17 differ by a step or so between fits on two halves of the data, and 8 rare quadrants may be swapped with their mirror. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
5f12643 to
ce8839b
Compare
|
Plan for the other BCPack modes, so nobody duplicates it. No code yet. @NiiRoZz (#340), @Prime1997 (#438), @Ahmet-Dedeler (bcpack-rs): say if any of this is already yours. What's unclaimed.
How. We fit the missing constants from our own copy of a retail title. We read it in place, and nothing from it leaves the machine except the fitted constants. Each value is voted on by byte equality: a packed mip-0 block against the plain block that must equal it (a plain duplicate of the same mip, or the next mip where both are one flat colour). An entry needs a clear majority. The rest stay unknown, and a request that needs one is refused before anything is written. Tables from other decoders whose licence doesn't fit XCL's GPL-2.0-only are not used or compared against. Checks.
PRs, each under ~400 lines.
Provenance. These are constants fitted from retail data, the same open question as #273's BC1 tables. Each PR will say so, and how each value was obtained, so it can be decided once for all of them. 🤖 Claude Opus 5.5 |
|
Hi @Kalmarv, I’m adding a test-only regression for the BC1 physical-page destination path in this PR using the existing synthetic fixtures. The test will check byte-for-byte writes across noncontiguous pages and verify that a truncated stream returns |
|
@gabrielsteglich, a follow-up PR, please: #273 is already at the size the maintainers asked for, and its smoke runs are on the current head. Base it on #273's branch (or on main once #273 merges) and say so in its description; I'll answer review points on the #273 side if the test finds anything. 🤖 Claude Opus 5.5 |
|
Provenance check + NVIDIA RTX 5080 Windows test run on Review
Tested
Not tested
AI use: review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above. |
|
Sorry, just saw all these notifications. If anything is done to update the code I have done, my tool will know and close the request. Just tag me if you see anything @Kalmarv that is mine that you want to work on. |
Integrate upstream ivall/xcl PR #273 (including #208), by Kalmarv, head ce8839b938e06767379be0cc1f84f366a5609bb3. Preserve synthetic test fixtures and third-party provenance. Only BC1 reconstruction is supported; other modes remain unsupported. No Windows build or GPU tests performed here. Assisted-by: ChatGPT (GPT-6.2)
|
#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. Thank you for the work and for collecting the retail runs – they showed where the BC1 wall was. The merged decoder decodes the BC1 blocks bit for bit with the reference (no estimated tables, no unknown history entry); your #208 fixtures test its lane stage. |
Stacked on #208. With this PR, DirectStorage unpacks BCPack BC1 requests, alone or after zlib, instead of refusing them. The BC1 blocks are rebuilt from #208's lanes with two tables of constants that no stream carries; XCL takes the estimates bcpack-rs made of them. BC3–BC7 requests are refused and counted as on
main.This is the second half of #208's earlier form (
a7ffb2f), which a tester ran on a retail title (below). One commit,ce8839b, on #208's42c90e0, which is onmain9ce2070; GitHub shows both commits until #208 is merged. Both were rebased from5f12643and34c0ee5on9ab7d76, without conflicts and without a changed line (git range-diff: both commits=).What is in it
hle/bcpack/bc1.rs: BC1 blocks from the 12 lanes. A back-reference for the endpoints, six zigzag differences, and four 2×2 selector quadrants through a codebook. It follows the BC1 sections of the format notes of bcpack-decoder and bcpack-rs, both MIT. No code was taken from either. The file's header names both, with URL and licence.hle/bcpack/bc1_fitted.rs: the two tables, which no specification publishes. One is the 255 endpoint sets a stream starts with; the other is the order of the 256 quadrants.python scripts/gen_bcpack_bc1_tables.py <bcpack-rs>/data/bc1_window.json <bcpack-rs>/data/bc1_quad_table.json(bcpack-rs at c51ec52; the script is in this PR). The file carries bcpack-rs's MIT notice.hle/bcpack/mod.rs:decode(mode, bytes, len)(lanes, then blocks), and the errorslane 1andunknown history.hle/dstorage.rs: a BC1 request runs the BCPack stage after zlib, or alone.E_DECOMPRESSIONand writes nothing, as a refusal does.XCL_DSTORAGE_BCPACK_FILLnow applies to the refused modes only.report.rs:report.jsongetsdstorage.bcpack_unpackedper mode, withrequests,destination_bytes(bytes of blocks rebuilt) andfailed.tests/data/bcpack/*.bc1: the blocks of DirectStorage: BCPack entropy stage for all modes, not yet called #208's BC1 fixtures, from the same independent encoder.THIRD_PARTY.md:bc1_fitted.rs, generated by the script above).Tested
cargo test --workspace -- --test-threads=4once8839b: 692 passed, 0 failed, 41 ignored, with DirectStorage: BCPack entropy stage for all modes, not yet called #208's commit under it (thexcllibrary: 652 passed, 21 ignored). SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware, both "no wave64".cargo test -p xcl --lib bcpackonce8839b: 11 passed, 0 failed.cargo build -p xclgives one warning, inhle/xgameruntime/mod.rs, which this PR does not touch.a7ffb2f, merged ontomain60565c4plus D3D12.X: pipelines in two passes are drawn (console MS via DispatchMesh, VS+GS via Draw*) #215. "Without" is the same branch before the merge.report.json'sdstorage.bcpack_refusedcompared.a7ffb2f.git diff 6da33fa a7ffb2fandgit diff 9ab7d76 5f12643differ only in the provenance comments oflanes.rsandbc1.rs, which now carry the sources' URLs; no code line differs.git diff 9ce2070 ce8839b, the stack as rebased, has the same changed lines asgit diff 9ab7d76 5f12643.mainhas moved since, so it is the same change but not the same build.More from that run:
BCPack BC1: first request unpacked (39541 to 65536 bytes), and one BC1 stream was not unpacked (BCPack BC1 streams not unpacked so far: 1).XCL_RUN_SECONDSended the run.cargo test --release -p xcl --lib bcpack: 11 passed.Retail run, by @vibryxcx (DirectStorage: BCPack BC1 requests are unpacked, tables from bcpack-rs #273 (comment)): RX 6800 (RDNA2, driver 32.0.21045.5002), Core i5-10600KF, Windows 11 26200, Rust 1.100.0, release.
main508a0c7, this PR's earlier head5f12643(then onmain9ab7d76), and5f12643merged into508a0c7(no conflicts).cargo test --workspace -- --test-threads=4on5f12643: 659 passed, 0 failed, 40 ignored, no SKIPPED GPU tests.mainagainst the merge: BC1 6 refused (393,216 bytes) to 6 unpacked, 0 failed; BC5 100 and BC7 20 refused in both; failed DirectStorage requests 126 to 120; 817 and 736 frames; peak commit 15,612 and 15,593 MB; no crash or device removal. One run of each.scripts/smoke.ps1:main1562 frames,5f12643on its own 30 frames (1 present per 2 s), the merge 1544 frames. So the slowdown came from the older base, and that head failed the 80 % frames rule againstmain. This is why the PR is rebased; the rebased head has not been run on that card.Retail run, by @0klavair (DirectStorage: BCPack BC1 requests are unpacked, tables from bcpack-rs #273 (comment)): RTX 5060 8 GB (driver 621.01), Ryzen 9 5950X, 32 GB RAM, Windows 11 23H2 (22631), rustc 1.94.1, release.
main508a0c7against508a0c7with5f12643merged in, into world loading, with warm caches. Both builds also carry a one-line launcher fix of theirs, outside DirectStorage.main; with the PR none refused, 1,913 unpacked (142.6 MB) and 1 failed. The failure isBC1 block 0 refers to the unknown history entry 4, the entry listed as not known below.+0x23cf683) after about 5 min 25 s, the stop of Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub #505 / Retail title: null write at +0x2215c35 (#159) still hits on NVIDIA RTX 4070 Ti, with and without XCL_NETWORK=0 #232, and show nothing past the loading screen. So the PR did not change where or when the run ends.What the tests show, all on synthetic data:
bc1_fixtures_decode_to_their_blocks: DirectStorage: BCPack entropy stage for all modes, not yet called #208's independent BC1 fixtures decode to their blocks.bc1_block_rebuild: one block by hand, every field.fitted_bc1_tables_are_well_formed: every quadrant appears once, the ranges hold, and one block goes through the shipped tables.bcpack_bc1_requests_are_unpacked_alone_and_after_zlib: seven requests through a memory queue.IntermediateSize.IntermediateSize, a cut stream and a wrong block count; these three fail and write nothing.main's BCPack refusal tests now use BC3 / BC7 where they used BC1.With the fitted tables, five BC1 streams (8,926 blocks) give byte-identical blocks here and in bcpack-rs's CLI.
Mutations of the earlier form, each failing at least one of these tests:
execute;IntermediateSizenot compared.DirectStorage: BCPack entropy stage for all modes, not yet called #208 lists its other six.
Known to be approximate or assumed:
The BC1 tables are estimates. Per bcpack-rs:
A wrong history entry gives a slightly wrong colour in the blocks that refer to it and in the ones chained to them. bcpack-rs reports a median 35.4 dB against the next mip level, where 37.9 dB is the ceiling of that measure.
BC1 lane 1 is 0 in every stream the notes describe. A stream where it is not is refused (
lane 1); bcpack-rs ignores it instead.One request is taken to be one stream that unpacks to
DestinationSizebytes.IntermediateSize0 with zlib + BCPack is accepted; zlib may then yield any size up to the destination's. The GDK documents the field as the size of the stream BCPack reads. What a console does with 0 was not tested.The blocks are written in stream order. Requests with a swizzle mode are still refused.
Overlaps:
hle/dstorage.rs, so the two conflict there. It is opt-in (XCL_DSTORAGE_BCPACK_BC1=1) and takes the decoder from the bcpack-rs crate, a git dependency pinned to c51ec52 (MIT). It handles BC1 alone and zlib → BC1, into virtual or physical-page destinations. It rejects malformed streams, unknown lane-1 symbols and unfitted entries. It also changes the window title (present.rs,pso_async.rs), and its run on a title saw no BCPack request. This PR differs as follows:THIRD_PARTY.md, and takes only bcpack-rs's two generated tables;executeinhle/dstorage.rs: a destination page-array entry that is 0 at enqueue is read again at the request's turn. It is merged and is in9ce2070; the rebase onto it had no conflict. Its change is in the physical-page write; this PR's is in the stages before it (zlib, then BCPack). A BC1 request into physical pages now goes through DirectStorage: a destination page array entry that is 0 at enqueue is read at the request's turn #289's late read too; that combination is not tested.5f12643, so it needs a rebase ontoce8839b. Other open PRs that touchhle/dstorage.rs(kernelx: keep lazy pages on failed MEM_COMMIT (#467) #487, Memory: writes into a sparse window are checked without VirtualQuery #501, DirectStorage: a deferred page-array entry is reread without faulting (#476) #509, DirectStorage: a late page array holds a half-full queue until Submit #549, DirectStorage: a memory source is copied without faulting #561) merge withce8839bwithout conflicts (git merge-tree).HANDOFF.mdsays "BCPack (and other console formats) are refused". With this PR that holds for every mode but BC1.docs/specs/2026-11-20-xcl-design.mdnames BCPack as having "no public decoder (risk)". Neither is edited here.scripts/smoke.ps1, 60 s, no input:main9ab7d761505 frames, peak commit 14902 MB; this PR5f126431503 frames, 14883 MB; exit 0x0, 0 device removals and 0 crashes in both.main85bdf21against it with5f12643merged: BC1 refusals 114 (3,383,296 bytes) to none,BCPack BC1: first request unpackedin the log; failed DirectStorage requests 220 to 26. BC5 and BC7 requests are still refused.cargo test --workspace -- --test-threads=4on5f12643: 659 passed, 0 failed, 40 ignored, no SKIPPED GPU tests (RDNA4).main9ab7d76and this head: 1505 frames onmain, no crash or device removal on either (DirectStorage: BCPack BC1 requests are unpacked, tables from bcpack-rs #273 (comment)).Regression run
Our own runs, one after the other on the machine under Tested (RTX 5070 Ti), release builds, no uncommitted changes.
main:
PR:
Not tested
scripts/smoke.ps1, was ofa7ffb2f, and is not a substitute for it.physical_page_destinations_and_sourcescovers.AI use