runtime: experiment with metadata-backed compressed chunk windows #1609

Open
SuperCraft3M wants to merge 4 commits from upstream-pr/1616 into main
SuperCraft3M commented 2026-11-24 15:05:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SuperCraft3M on 2026-11-24T15:05:43Z.


Change

Add an opt-in experiment for bounded partial outputs from RDS5 BCPack and zlib chunks with X2W_DSTORAGE_CHUNK_WINDOWS=1. The boundary table must supply one matching codec, compressed size and 64 KiB source-window offset. The runtime decodes and verifies the whole declared chunk before writing the requested window. Metadata and stored reads are capped at 1 MiB, and the decoded chunk at 16 MiB. Ambiguous matches, invalid extents, out-of-range windows and corrupt streams are refused.

Refs #1198. The source-window convention remains experimental. The rebase preserves the BCPack formats supported by the ordinary decode path on current main.

Verification

Head 1bbca21f on 18f2f85c, Windows 11 build 26300.9711, MSVC 19.44.35230, Release.

cmake --build --preset release --target startup_chunk_window_check startup_stub_xcrdapi startup_stub_consumer --parallel 3
cmake --build --preset release --target startup_stub_acphal startup_stub_xapu startup_stub_gameinput --parallel 3
ctest --preset release --no-tests=error -R '^(startup_chunk_windows|startup_stubs)$' --output-on-failure

2 passed, 0 failed, 0 skipped. The source-built probe compares exact bytes and destination guards for 64 KiB BC1 and zlib windows. It now also checks 8 KiB zlib outputs at the first and continuation offsets and checks untouched destinations with the option disabled.

AI-assisted (Codex).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5474749271 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1616). Originally posted by [SuperCraft3M](https://github.com/SuperCraft3M) on 2026-11-24T15:05:43Z. --- ## Change Add an opt-in experiment for bounded partial outputs from RDS5 BCPack and zlib chunks with `X2W_DSTORAGE_CHUNK_WINDOWS=1`. The boundary table must supply one matching codec, compressed size and 64 KiB source-window offset. The runtime decodes and verifies the whole declared chunk before writing the requested window. Metadata and stored reads are capped at 1 MiB, and the decoded chunk at 16 MiB. Ambiguous matches, invalid extents, out-of-range windows and corrupt streams are refused. Refs #1198. The source-window convention remains experimental. The rebase preserves the BCPack formats supported by the ordinary decode path on current main. ## Verification Head `1bbca21f` on `18f2f85c`, Windows 11 build 26300.9711, MSVC 19.44.35230, Release. ```powershell cmake --build --preset release --target startup_chunk_window_check startup_stub_xcrdapi startup_stub_consumer --parallel 3 cmake --build --preset release --target startup_stub_acphal startup_stub_xapu startup_stub_gameinput --parallel 3 ctest --preset release --no-tests=error -R '^(startup_chunk_windows|startup_stubs)$' --output-on-failure ``` 2 passed, 0 failed, 0 skipped. The source-built probe compares exact bytes and destination guards for 64 KiB BC1 and zlib windows. It now also checks 8 KiB zlib outputs at the first and continuation offsets and checks untouched destinations with the option disabled. AI-assisted (Codex).
descent81 commented 2026-11-24 16:03:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by descent81 on 2026-11-24T15:38:44Z.


I tested cf1c29a6 on Windows 11 x64 / MSVC 19.50 Release, applying the runtime and fixture changes over 7c5dac78. I extended the source-built queue fixture to request 8 KiB from the synthetic zlib record while retaining the existing 64 KiB cases. Both the first window and the continuation returned S_OK, matched all 8,192 reference bytes, and left the 16-byte destination guard untouched. The existing rejection controls still passed.

The fixture change is small: give the C++ runtime helper an optional output-size parameter defaulting to 65,536, use it for the request size, destination allocation and comparison boundary, and call it again in the enabled zlib case with 8,192. Keep the continuation offset at 65,536. The existing Python harness can run the extended consumer without any additional inputs.

In a separate local startup run, the enabled experiment had served 77 metadata-backed windows with zero failed requests at the 240-second sample. The same pre-enqueue length assertion still repeated and eventually reached the debugger's continuation limit. The synthetic result narrows the remaining question to how the caller forms and validates the partial request. It does not establish a fix for that assertion or confirm scene startup.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7136374225 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1616#issuecomment-7136374225). Originally posted by [descent81](https://github.com/descent81) on 2026-11-24T15:38:44Z. --- I tested `cf1c29a6` on Windows 11 x64 / MSVC 19.50 Release, applying the runtime and fixture changes over `7c5dac78`. I extended the source-built queue fixture to request **8 KiB** from the synthetic zlib record while retaining the existing 64 KiB cases. Both the first window and the continuation returned S_OK, matched all 8,192 reference bytes, and left the 16-byte destination guard untouched. The existing rejection controls still passed. The fixture change is small: give the C++ `runtime` helper an optional output-size parameter defaulting to 65,536, use it for the request size, destination allocation and comparison boundary, and call it again in the enabled zlib case with 8,192. Keep the continuation offset at 65,536. The existing Python harness can run the extended consumer without any additional inputs. In a separate local startup run, the enabled experiment had served 77 metadata-backed windows with zero failed requests at the 240-second sample. The same pre-enqueue length assertion still repeated and eventually reached the debugger's continuation limit. The synthetic result narrows the remaining question to how the caller forms and validates the partial request. It does not establish a fix for that assertion or confirm scene startup. AI-assisted.
R0Y00 commented 2026-11-25 07:01:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T06:42:14Z.


Local A/B follow-up with #1616's patch applied to the 56b801be XCRDAPI source. Both runs used the same rebuilt DLL (SHA-256 4151f8350127ec92a72c99b89276789e2e2d4002f40e78eb0cfaa5c78889844a) and switched X2W_DSTORAGE_CHUNK_WINDOWS in separate processes.

Setting Last storage heartbeat Successfully written metadata windows Total failed requests at that heartbeat
1 270 s 4,810 1
0 210 s 0 3,510

These cumulative counters were sampled at different elapsed times. Both runs still displayed the red screen, so the result establishes that the window route wrote data in the live workload. World rendering remains unresolved.

The same DLL passed the synthetic enabled and disabled checks for BCPack and zlib first/continuation windows, guard bytes and corrupt streams. Seven focused Release CTests passed, including allocation/refusal ordering and XMem page-token consumer regressions.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7155069848 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1616#issuecomment-7155069848). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T06:42:14Z. --- Local A/B follow-up with #1616's patch applied to the `56b801be` XCRDAPI source. Both runs used the same rebuilt DLL (SHA-256 `4151f8350127ec92a72c99b89276789e2e2d4002f40e78eb0cfaa5c78889844a`) and switched `X2W_DSTORAGE_CHUNK_WINDOWS` in separate processes. | Setting | Last storage heartbeat | Successfully written metadata windows | Total failed requests at that heartbeat | | --- | ---: | ---: | ---: | | `1` | 270 s | 4,810 | 1 | | `0` | 210 s | 0 | 3,510 | These cumulative counters were sampled at different elapsed times. Both runs still displayed the red screen, so the result establishes that the window route wrote data in the live workload. World rendering remains unresolved. The same DLL passed the synthetic enabled and disabled checks for BCPack and zlib first/continuation windows, guard bytes and corrupt streams. Seven focused Release CTests passed, including allocation/refusal ordering and XMem page-token consumer regressions.
tedin7 commented 2026-11-27 09:36:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T09:36:58Z.


This PR now conflicts with main. Conflicting files:

  • src/startup_stubs/xcrdapi.cpp

Could you merge main into your branch (a merge commit, no force push needed) and resolve these? Thank you.

AI-assisted; commands listed were executed locally. (git merge-tree origin/main <head>)

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7214890166 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1616#issuecomment-7214890166). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-27T09:36:58Z. --- This PR now conflicts with `main`. Conflicting files: - `src/startup_stubs/xcrdapi.cpp` Could you merge `main` into your branch (a merge commit, no force push needed) and resolve these? Thank you. AI-assisted; commands listed were executed locally. (`git merge-tree origin/main <head>`)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1616:upstream-pr/1616'
git switch 'upstream-pr/1616'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1616'
git switch 'upstream-pr/1616'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1616'
git switch 'upstream-pr/1616'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1616'
git switch 'main'
git merge --squash 'upstream-pr/1616'
git switch 'main'
git merge --ff-only 'upstream-pr/1616'
git switch 'main'
git merge 'upstream-pr/1616'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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!1609
No description provided.