Skip to content

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

Draft
SuperCraft3M wants to merge 4 commits into
R0Y00:mainfrom
SuperCraft3M:runtime/metadata-chunk-windows
Draft

SuperCraft3M wants to merge 4 commits into
R0Y00:mainfrom
SuperCraft3M:runtime/metadata-chunk-windows

Conversation

@SuperCraft3M

@SuperCraft3M SuperCraft3M commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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).

Copy link
Copy Markdown
Contributor

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 Nov 25, 2026

Copy link
Copy Markdown
Owner

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.

@SuperCraft3M
SuperCraft3M force-pushed the runtime/metadata-chunk-windows branch from 1981d68 to 1bbca21 Compare November 25, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants