cpu: draw a selected page from a sixteen-page zlib record #1353

Manually merged
github merged 2 commits from gh-pr/1353/head into gh-pr/1353/base 2026-11-26 23:00:30 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 08:59 UTC · original
R0Y00:codex/guest-sixteen-page-record → main · +167 −38 · 8 files · 2 commits · merged 2026-11-24 09:16 UTC

Refs #1198. Depends on #1345. Please merge #1345 into main first, then retarget this PR to main.

The compiler-built EXE can select one requested 4 KiB page inside a 16-page RFC 1950 record. The guest supplies the full compressed source range, the declared decoded capacity in bytes, and the byte offset inside that destination. The Windows queue inflates the complete 64 KiB record. Once both statuses complete, the existing provider extracts the requested pages, uploads the BC7 texture and draws. The fixture supports standalone one-page and sixteen-page intervals.

A two-record source-built file has sixteen differently colored pages in the first stream and a seventeenth color in the second. The independent readback checks exact guest arguments, both queue statuses, every expanded destination byte and both guards, the selected pages, storage object releases, full RGBA output, fence and device references. Cases select page 0, 7 or 15 followed by the second record, then reverse record order to put the 16-page output second. An out-of-range second request leaves the queue unopened. Truncating either compressed checksum fails only that request, keeps the entire destination unchanged, finishes the other request and exits 6 without a draw.

Local Windows 11 build 26200.9974, Release 5f994492. RTX 4060 Laptop GPU driver 32.0.16.1656 and WARP 10.0.26100.9818, debug layer off. Across native PE, mapped PE and AOT: 42 new executions including 24 full frames, 12 checksum truncations and six pre-enqueue rejections. No skips. Both brand-new CTests, both existing directory CPU/GPU comparisons and the queue-directory regression passed (5/5). Markdown link check passed (300 links).

cmake --build --preset release --target archive_directory_lifted pe_map startup_stub_consumer startup_stub_xcrdapi
ctest --preset release --no-tests=error --output-on-failure -R '^(cpu_archive_(sixteen_page|directory)_gpu_(warp|hardware)|startup_storage_directory_batch)$'
**@⁠R0Y00** on GitHub · 2026-11-24 08:59 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1353) `R0Y00:codex/guest-sixteen-page-record` → `main` · +167 −38 · 8 files · 2 commits · merged 2026-11-24 09:16 UTC Refs #1198. Depends on #1345. Please merge #1345 into main first, then retarget this PR to main. The compiler-built EXE can select one requested 4 KiB page inside a 16-page RFC 1950 record. The guest supplies the full compressed source range, the declared decoded capacity in bytes, and the byte offset inside that destination. The Windows queue inflates the complete 64 KiB record. Once both statuses complete, the existing provider extracts the requested pages, uploads the BC7 texture and draws. The fixture supports standalone one-page and sixteen-page intervals. A two-record source-built file has sixteen differently colored pages in the first stream and a seventeenth color in the second. The independent readback checks exact guest arguments, both queue statuses, every expanded destination byte and both guards, the selected pages, storage object releases, full RGBA output, fence and device references. Cases select page 0, 7 or 15 followed by the second record, then reverse record order to put the 16-page output second. An out-of-range second request leaves the queue unopened. Truncating either compressed checksum fails only that request, keeps the entire destination unchanged, finishes the other request and exits 6 without a draw. Local Windows 11 build 26200.9974, Release 5f994492. RTX 4060 Laptop GPU driver 32.0.16.1656 and WARP 10.0.26100.9818, debug layer off. Across native PE, mapped PE and AOT: 42 new executions including 24 full frames, 12 checksum truncations and six pre-enqueue rejections. No skips. Both brand-new CTests, both existing directory CPU/GPU comparisons and the queue-directory regression passed (5/5). Markdown link check passed (300 links). ```powershell cmake --build --preset release --target archive_directory_lifted pe_map startup_stub_consumer startup_stub_xcrdapi ctest --preset release --no-tests=error --output-on-failure -R '^(cpu_archive_(sixteen_page|directory)_gpu_(warp|hardware)|startup_storage_directory_batch)$' ```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:00:28 +00:00
github manually merged commit 4dd0f73e25 into gh-pr/1353/base 2026-11-26 23:00:30 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 09:04 UTC · original · reviewed

Technical peer-review at commit 5f9944929cdedd216d979a4d8eb799ca76de7f43:

Verification

  • Linux:
    • git diff --check origin/main...HEAD: clean.
    • tests/docs_links_check.py: passed (16 Markdown files, 300 links).
    • tests/bidi_controls_check.py: passed (1114 tracked files).
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): cmake --build --preset dev --target startup_stub_consumer archive_directory_gpu archive_directory_lifted pe_map succeeded (24.61s); ctest --preset dev -R '^(startup_storage_directory_batch|cpu_archive_directory_gpu_warp|cpu_archive_sixteen_page_gpu_warp)$' 3/3 passed (10.03s).
    • Release /O2 (--preset release): build succeeded (36.72s); same CTest selection 3/3 passed (9.85s).

Code & Test Notes

  • tests/cpu/archive/directory_reader.zig: validate() checks the RDS5 header, entry count bounds against both the readable prefix and metadata offset, strictly monotonic physical/logical boundaries, terminal physical <= file_size, and logical << 12 against the header size. locate() binary-searches the directory, restricts intervals to 1 or 16 pages with codec == 8, and guards span - padding against underflow/overflow.
  • tests/cpu/archive/directory_gpu.cpp & tests/cpu/archive_directory_multipage_check.py: verify 32-byte 0xa5 destination guards, full 16-page decompressed buffers, selected 4 KiB page extraction, file identity, queue statuses, storage refcount releases (0 0 0), out-of-range pre-queue rejection (exit 3), and truncated-stream negative controls (exit 6).
  • Minor nit: CMakeLists.txt line 3974 uses ${CMAKE_SOURCE_DIR} while the adjacent cpu_archive_directory_gpu_${adapter} test on line 3971 uses ${CMAKE_CURRENT_SOURCE_DIR}.
**@⁠tedin7** on GitHub · 2026-11-24 09:04 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1353#pullrequestreview-6036369715) · **reviewed** Technical peer-review at commit `5f9944929cdedd216d979a4d8eb799ca76de7f43`: ### Verification - **Linux**: - `git diff --check origin/main...HEAD`: clean. - `tests/docs_links_check.py`: passed (16 Markdown files, 300 links). - `tests/bidi_controls_check.py`: passed (1114 tracked files). - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - **Debug (`--preset dev`)**: `cmake --build --preset dev --target startup_stub_consumer archive_directory_gpu archive_directory_lifted pe_map` succeeded (`24.61s`); `ctest --preset dev -R '^(startup_storage_directory_batch|cpu_archive_directory_gpu_warp|cpu_archive_sixteen_page_gpu_warp)$'` **3/3 passed** (`10.03s`). - **Release `/O2` (`--preset release`)**: build succeeded (`36.72s`); same CTest selection **3/3 passed** (`9.85s`). ### Code & Test Notes - `tests/cpu/archive/directory_reader.zig`: `validate()` checks the `RDS5` header, entry count bounds against both the readable prefix and metadata offset, strictly monotonic physical/logical boundaries, terminal `physical <= file_size`, and `logical << 12` against the header size. `locate()` binary-searches the directory, restricts intervals to 1 or 16 pages with `codec == 8`, and guards `span - padding` against underflow/overflow. - `tests/cpu/archive/directory_gpu.cpp` & `tests/cpu/archive_directory_multipage_check.py`: verify 32-byte `0xa5` destination guards, full 16-page decompressed buffers, selected 4 KiB page extraction, file identity, queue statuses, storage refcount releases (`0 0 0`), out-of-range pre-queue rejection (exit 3), and truncated-stream negative controls (exit 6). - Minor nit: `CMakeLists.txt` line 3974 uses `${CMAKE_SOURCE_DIR}` while the adjacent `cpu_archive_directory_gpu_${adapter}` test on line 3971 uses `${CMAKE_CURRENT_SOURCE_DIR}`.
This discussion has been locked. Commenting is limited to contributors.
No description provided.