Validate variable BCPack lanes against a reproducible BC7 block reference #15
Closed
opened 2026-11-21 08:29:28 +00:00 by R0Y00
·
8 comments
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
R0Y00/Xbox2Windows#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T08:29:28Z.
The fixed-symbol prefix probe reproduces an initial state and byte budget for a small subset of lanes. Recovering a BC7 block also requires the variable-symbol distributions, the order in which lanes consume refill bytes, and the mapping from lane outputs to block fields.
Use an original or redistributable test packet and independently known BC7 block rows. Record the block count and expected output. Verify the initial state, each refill and terminal state before comparing complete block rows byte for byte. A prefix match alone leaves pixel reconstruction open.
Reference: the published SixNG BCPack experiments, section 6.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T08:42:00Z.
PR #17 adds a first-round check using original synthetic inputs. Run
python -B tests/bcpack_check.pyto exercise an explicit eight-lane participation mask and a deliberately swapped byte. For a source-owned packet,tools/bcpack_probe.pyaccepts an independently known symbol count and an optional--prefetch-maskto test the first refill position. Later refill positions, variable-symbol decoding and verification against known BC7 blocks remain open.Imported from R0Y00/Xbox2Windows. Originally posted by mesterember104-cpu on 2026-11-21T13:39:49Z.
Aggregate observations from a local copy of the same case-study build (the CYBERLEEK November Xbox package referenced in the README). Reproduction script inline at the bottom; no game data is shared.
AI disclosure: this comment was drafted, and all measurements below were collected, by an AI agent (GLM, operated by the account owner). The script is deterministic and self-contained, so anyone with a local build can verify every number independently.
Independently established inputs
data/ttdb/graphics/ttdb_graphics.ttpf(32.8 MB RDS5 store): 1,549 chunks per the SixNG §5 chunk-table formulas — 1,402 zlib, 100 BC5, 27 BC7/BCPack (codec 0x1C), 19 BC1, 1 BC3?. Block counts for the 27 BC7 streams come from chunk virtual extents (next entry's virtual offset minus this one, divided by 16): 2×1024, 1×2048, 14×4096, 10×16384 blocks. Stored sizes run 13.5–257.8 KB, ≈12% under virtual size.Why the probe finds zero lanes on BC7
tools/bcpack_probe.pyreads lane records asprefix[lane::8]and accepts only the BC1 constant modesdc/dd/de. On all 27 real streams it reports zero lanes. Reading the first 48 bytes as 8 lane records of 6 bytes (stride 6) — which is the SixNG §6 header layout — changes the statistics completely:Lane 1 is a plane-type parameter lane in BC7
At stride 6, lane 1 carries a plane-type mode in 25/27 streams — the structural analogue of BC1's constant lane 1 (
de), but from a different family:0x7b×8,0x7a×6,0x3c×5,0xfa×2,0xba×2, and0x97/0x3b/0x5b/0xb9once each — types 0x1a/0x1b/0x1c with parameters 1–7 (BC1's constant lanes are types 0x1c–0x1e, parameter 6).Two record shapes:
0x0303in 14/27 streams (cf. BC1's fixed-parameter records10 03 40 00 xx 00).The remaining budgets correlate with the derived block counts (1024 → 59/186; 16384 → 91/122), which constrains lane-length models the same way
--blocksverifies BC1 constant lanes.Open
Reproduction
Run:
python ttpf_lane_fixture.py <build>/data/ttdb/graphics/ttdb_graphics.ttpf [--export out], thenpython -B tools/bcpack_probe.py <exported-file> --blocks <count-from-filename>.A stride-6 reader in the probe plus one verified K for 0x7a/0x7b/0x3c that re-encodes a real lane-1 record byte for byte would close the identification half of this issue.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T14:38:21Z.
Thanks for the reproducible measurements. I independently read the local RDS5 table and confirmed 1,549 data segments and 27 mode-7 segments. At six-byte spacing I also get 40/216 candidate mode positions and 25/27 hits at position 1. One discrepancy worth resolving before fitting the decoder: using the table beginning at byte 16, its final sentinel and successive logical offsets, I get 2 × 1,024, 1 × 2,048, 13 × 4,096 and 11 × 16,384 blocks. Our reader treats the final table record as an end sentinel. Can you compare the final mode-7 segment using its declared logical end rather than its stored byte length? The histogram supports investigating the six-byte interpretation. The decisive next test is an independently known BC7 block or a byte-exact lane re-encode. Aggregate counts are sufficient for comparing the local inputs.
Imported from R0Y00/Xbox2Windows. Originally posted by MarlomMedeiros on 2026-11-21T15:21:44Z.
Extending the published BCPack format notes (06-bcpack.md) to BC7, under
the spec's ttpf parse. Corpus: the GTA VI Xbox ttpf set, 46 files, 45 with
codec-0x1C chunks, 5,120 chunks total; single package, no second source.
Main-lane records [mode=0xde][budget-1][state4] with budget-1 = 3 contain
32-bit values identical to the encoder-final states of pure constant rANS
runs under the published constant-lane model (M=2^16, L=2^24,
repeated-symbol freq M-K, slot 1).
1,252/1,252, on every lane where such records occur (2-7), across the
38 stores that contain them (167 distinct states; one repeats 466x).
of 1,737: the 1,252 plus 29 header matches whose budgets equal the
model's renorm count at their recovered symbol counts. For all 29 the
model's predicted first emitted byte equals the stream byte at the
deduced round-1 position (consistent, though those bytes are locally
common, so supporting rather than decisive).
lane is K=32 on lanes 2-6 and K=16 on lane 7. Individual records can
sit on a second chain; the per-lane intersection is unique. Lane 7's
K=16 departs from the spec's BC1-derived mode->K table.
block count from the spec's virtual-offset deltas (827 records; 4 at
1x; the other 421 verified records carry counts 7-9,703 untied to
blocks, e.g. fixed 128-symbol runs in multi-stream chunks).
fixed lane K is ~3e-6 to 5e-6 per record; expected false hits among
1,252 is ~0.004. For calibration, the same formal test yields ~11 hits
among the ~39k non-0xde param-6 records.
verified_constant_lane on real prefixes for lanes 2-6 with --blocks set
to the recovered symbol count. Example: ttdb_interiors_0_3.ttpf,
chunk-table entry 1604 (1536 blocks), --blocks 3072 reports lane 6.
Lane-7 records verify by changing EXCEPTIONS[0xde] to 16 in a separate
run (one K per mode per run). Reproducing needs the same package, which
cannot be redistributed; the full hit list is countable from the rules
above.
Actionable for this issue: in chunks carrying these records, the named
lanes appear to be constant runs and can likely be pruned from the
variable-lane search, and the recovered symbol counts (2x and 1x blocks,
plus fixed 128-symbol sub-stream runs) are hard checks for any candidate
BC7 decoder.
Not yet established: the semantic role of these lanes (endpoint/subset
planes); the remaining 456 mode-0xde records with budget-1>3 that do not
fit the lane-K model (one sits on a K=8 chain at a mismatched budget;
deeper scans may move a few more onto non-lane chains); and the nature of
the type-0x1b records concentrated on lanes 0-1 (formally chain states at
K=2 with degenerate n~128; possibly packed parameter fields).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T15:22:58Z.
Thanks @descent81. #69 is merged. For an explicitly supplied second-round participation mask, the probe now checks the predicted offset and value of the second refill byte. The regression changes only that byte and verifies that the first check still passes. The variable-symbol model, mask inference and independently checked BC7 block output remain open here.
Imported from R0Y00/Xbox2Windows. Originally posted by MarlomMedeiros on 2026-11-21T18:53:58Z.
Corpus-wide follow-up on the refill-order and lane-model questions. All measurements below come from the local archive's 5,120 BC7 chunks plus two extracted packet prefixes (512 and 1,536 blocks), read-only. Every claim has a runnable Python check behind it; happy to share them.
Constant-lane model: the K table is lane-dependent
The mode -> escape-slot count map is not global; the same mode carries different alphabet sizes on different lanes:
0xde0xdeLOWERwith K=16 and fails with K=32 at an escape near step 25790xdb0xdc0xddSymbol counts: endpoint lanes encode
2*blockssymbols, notblocks(843 of the verified hits:N_sym=1024in the 512-block prefix,N_sym=3072in the 1,536-block prefix). The remaining verified lanes are fixed 128-symbol lanes, and 65,536-block chunks split into two independent 32,768-block streams.The published
EXCEPTIONStable covers only the lane-2..6 K=32 case, so roughly a third of the corpus-verifiable constant lanes are out of reach of the current model.Header records decoded
Mode byte bit 5 is a length-width flag, not a parameter field:
Validation: zero negative stream budgets across all 5,120 chunks; zero violations across 11,225 bit5=0 records; 3,354 bit5=1 records have a zero high length byte, consistent with a real 16-bit field.
Physical layout: fixed 8-byte rounds, secondary headers fill gaps
Rounds are fixed 8-byte slots, not packed reads. Round 6 carries 4th state bytes for bit5=1 lanes plus first refill/prefetch bytes; secondary lane headers immediately claim any slot a main lane frees. Round 7 always starts at offset 56, regardless of how many main lanes read in Round 6.
Verified byte-by-byte on a real 4,096-block chunk (
prefetch_mask = 0xef):[0xfc, 0xff]at offsets 51 and 59[0xce, 0xaf]at offsets 54 and 61s0(0xde, K=16) header interleaves at 55 (mode) and 62 (len8);s1(0xdc, K=4) mode lands at 63Later refills are demand-driven:
refill[i+1]surfaces mid-stream only at the decode step whererefill[i]is consumed. Confirmed on a 16,384-block stream and on both halves of a dual-32,768-block stream: five refills each land as multi-lane byte clusters at stream fractions within ~0.001 of the predicted decode-step fraction.Audit of the merged #175 model
Confirmed: per-lane FIFO refill consumption and the unbudgeted-read reporting both match real streams.
Refuted on real streams:
48 + popcount(mask). Secondary headers fill freed Round-6 slots, so Round 7 always begins at offset 56. The formula lands off by one on the verified chunk above (it computes 55, which sits on thes0mode byte).refill[0]in Round 2" never occurs on a constant lane: 59/59 takerefill[0]in Round 6, while bit5=1 lanes read their prefetch byte in Round 7.--next-maskmatches reality only for lanes whose escape sits at decode step 0. Later escapes consume their byte mid-stream at the demand point, not in Round 2.EXCEPTIONStable misses K=16 (0xdelane 7) and K=2 (0xdb), which limits real-lane coverage for anything built on it, including the supplied-refills decode path in #214.What stays open
Variable-lane zero-refill states (
0xda,0x5f,0x1f) do not fit the constant recurrence for anyKin{1,2,4,...,1024}or any start offset; the variable symbol models are still unknown. Observable signatures so far:0xdastates advance in exact +4.0101-bit steps, and0x5fstates cluster in delta-2 pairs. Lane-to-BC7-field assignment is also unresolved, though the per-lane mode alphabets strongly suggest each lane streams a different block field.Imported from R0Y00/Xbox2Windows. Originally posted by mesterember104-cpu on 2026-11-21T19:27:59Z.
Thanks for the independent confirmation of the stride-6 counts (40/216, 25/27) — and for the pointer on the final segment. Recounted, with one open difference left.
(Same AI-agent disclosure as before: numbers collected by GLM on the account owner's local copy; plain static table facts.)
Block-count recount
Reading the chunk table including its zero terminator (n = 1,550 records; last record
a=b=0), and taking every mode-7 segment's virtual extent from the next table entry's virtual offset — i.e. only the final non-zero entry would need the sentinel — I still get 2 × 1,024, 1 × 2,048, 14 × 4,096, 10 × 16,384. The final mode-7 segment is not the final table entry here (BC1 entries follow it), so its extent comes from the next entry either way.Per-segment table for direct alignment (stored bytes, blocks from next-entry virtual offsets, ratio = stored/decoded, stream sha256 prefix):
c8f0d85df5c1c15de481bb79ac01f8adb869638ab454528920b86e8c5ede5dea6e8ddd0f1086bad5167594a62c6310f43049440a301bf675bb9b2a67529d8f92f6462a9639248c6b3333a10f3081db29fe873a7efb9e07f640badcbddbc481dd10ffdb2ef308582bdeff396231aaac178fe0043da3a1eee2d7fe9de81c8f75a876e43951d341d107acdeb73dc0132578590c5ab0ebdcd18bec9af4dd0e1ce50db820Median ratio 0.879 (the "≈12% under virtual size" in my first comment = this 0.88 family).
The one differing segment
If your recount assigns 16,384 blocks to the final mode-7 segment, that segment is presumably #27 above (
0e1ce50db820, 61,184 stored bytes). Two observations for aligning:0e1ce50db820directly would pin whether we are segmenting the same bytes (my extent for it runs to the next entry's virtual offset; BC1 entries follow it in the table, and the store's zero terminator closes the table).Also: appreciation for the lane-dependent K table upthread (0xde lane 7 → K=16 etc.) — that plus these headers should make the graphics-store streams a compact test corpus for the refills.
If it helps, I can re-run with your exact sentinel semantics (e.g. last mode-7 segment ending at the terminator's declared logical end) and post the resulting per-segment deltas.
Imported from R0Y00/Xbox2Windows. Originally posted by Ahmet-Dedeler on 2026-11-21T22:45:42Z.
Hey, we got BC1 BCPack decoding end to end, and the entropy layer now converges on every codec in the GTA VI pools (BC1, BC3, BC4, BC5, BC6H, BC7). Code and notes: https://github.com/Ahmet-Dedeler/bcpack-rs
What unlocked it: Microsoft published the MDU rANS decoder as MIT Verilog in 2023, https://github.com/microsoft/silicon-rans (
mdu_minirans.v). It has the exact base/freq tables for 9 alphabet widths x 16 models, the 2/3 byte fragment header and the legal end states. It leaves out the feeder and the symbol vector assembly, which is the part this thread was mapping.What fills those gaps (each checked by exact convergence: every lane ends in a legal state and bytes consumed = stored length minus pad):
alphabet_bitsis lane width minus 1, which is why K depends on the lane (K = 2^(width - z)).BC1 semantics, in case it helps with BC7:
Thanks to MarlomMedeiros for the round schedule work and to the SixNG notes, they made the search a lot smaller.