cpu: publish RGBA8 textures from completed archive records #850

Manually merged
github merged 1 commit from gh-pr/850/head into gh-pr/850/base 2026-11-26 22:23:17 +00:00
Owner

@⁠descent81 on GitHub · 2026-11-23 13:01 UTC · original
descent81:cpu/archive-texture-publication → main · +128 −15 · 11 files · 1 commits · merged 2026-11-23 13:12 UTC

Refs #830

The existing archive reader tells us which decompressed bytes reached stdout. For the two-frame experiment we also need to know exactly what the upload code can see when the second decode fails. This adds a source-built Zig entry that shares the existing allocation, decode and release loop and selects a texture publisher at compile time.

Each complete record supplies one row-major 4×4 RGBA8 image to consume_archive_texture(const ArchiveTexture&). The red samples cycle through the decoded record. Green and blue identify the column and row, and alpha is opaque. The consumer has 16 bytes per row and owns no storage. It can copy the pixels during the call. The consumer in this PR writes the 64 bytes to stdout so the test can inspect every channel independently of D3D12.

What I checked

Input Native Windows, pe_map and AOT
Two complete records Both 64-byte images matched the reference in order. Two releases, two completions counted, exit 0. Substituting texture one for texture two would give nine incorrect red samples.
Second payload cut to four bytes blast delivered one tentative byte to its staging callback. Exactly the first 64-byte image reached stdout. Both allocations were freed, the completed count was one, and the process exited 2.

The comparison uses the two synthetic streams already in the archive suite. The mapped run maps the reader, codec and source decoder. The AOT executable uses the lifted reader and decoder. The original reader's raw-byte tests still pass.

Reproduction

Windows x64, Release, MSVC 19.50, Zig 0.13.0, commit 9b53759.

cmake --build --preset release --target archive_texture_lifted archive_all_lifted archive_reader_lifted pe_map cpu_shim_startup_lifted
ctest --preset release --no-tests=error -R '^(cpu_archive_texture_publication|cpu_native_archive_(reader|blast)|cpu_shim_upload_texture_(warp|hardware)|docs_links)$' --output-on-failure

Six passed, zero failed or skipped. The two existing upload tests each checked five 16,384-byte readbacks. Those runs establish the #814 baseline. Connecting this publisher to that upload path, submitting two draws on the same queue, and checking fences and frame readback remain open in #830. The consumer contract and standalone reproduction command are in the experiment notes.

AI-assisted.

**@⁠descent81** on GitHub · 2026-11-23 13:01 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/850) `descent81:cpu/archive-texture-publication` → `main` · +128 −15 · 11 files · 1 commits · merged 2026-11-23 13:12 UTC Refs #830 The existing archive reader tells us which decompressed bytes reached stdout. For the two-frame experiment we also need to know exactly what the upload code can see when the second decode fails. This adds a source-built Zig entry that shares the existing allocation, decode and release loop and selects a texture publisher at compile time. Each complete record supplies one row-major 4×4 RGBA8 image to `consume_archive_texture(const ArchiveTexture&)`. The red samples cycle through the decoded record. Green and blue identify the column and row, and alpha is opaque. The consumer has 16 bytes per row and owns no storage. It can copy the pixels during the call. The consumer in this PR writes the 64 bytes to stdout so the test can inspect every channel independently of D3D12. ### What I checked | Input | Native Windows, pe_map and AOT | | --- | --- | | Two complete records | Both 64-byte images matched the reference in order. Two releases, two completions counted, exit 0. Substituting texture one for texture two would give nine incorrect red samples. | | Second payload cut to four bytes | blast delivered one tentative byte to its staging callback. Exactly the first 64-byte image reached stdout. Both allocations were freed, the completed count was one, and the process exited 2. | The comparison uses the two synthetic streams already in the archive suite. The mapped run maps the reader, codec and source decoder. The AOT executable uses the lifted reader and decoder. The original reader's raw-byte tests still pass. ### Reproduction Windows x64, Release, MSVC 19.50, Zig 0.13.0, commit `9b53759`. ```powershell cmake --build --preset release --target archive_texture_lifted archive_all_lifted archive_reader_lifted pe_map cpu_shim_startup_lifted ctest --preset release --no-tests=error -R '^(cpu_archive_texture_publication|cpu_native_archive_(reader|blast)|cpu_shim_upload_texture_(warp|hardware)|docs_links)$' --output-on-failure ``` Six passed, zero failed or skipped. The two existing upload tests each checked five 16,384-byte readbacks. Those runs establish the #814 baseline. Connecting this publisher to that upload path, submitting two draws on the same queue, and checking fences and frame readback remain open in #830. The consumer contract and standalone reproduction command are in [the experiment notes](https://github.com/descent81/Xbox2Windows/blob/9b53759/docs/experiments.md#publishing-a-texture-from-each-complete-archive-record). AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:23:16 +00:00
github manually merged commit 9b5375996e into gh-pr/850/base 2026-11-26 22:23:17 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.