cpu: select BC7 storage ranges from a bounded guest directory #1338
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1345"
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-24T08:47:57Z.
Refs #1198 and #870. Follows #1331.
Let the compiler-built guest select both requests from a raw file prefix of up to 64 KiB. It validates the RDS5 directory and both logical pages, binary-searches for each requested record, and computes its source range. Queue creation and submission remain in the existing Windows provider. The guest's lookup function has an explicit PE export so the AOT verifier can identify the leaf function.
The three runners use the same underlying files. The controls distinguish three ways to get the same incorrect first half of the BC7 frame:
The ordinary two-page batch also selects entry 2 then jumps to entry 3585. Two ETPF metadata sizes change the absolute start of the compressed data. An oversized count, an out-of-file terminal boundary, and an unavailable second page each return 3 before the provider creates the queue. Moving only the first physical offset to EOF returns 6, leaves that page untouched and completes the second request.
Windows 11 build 26200.9974 x64, Release
4f3f79a2, RTX 4060 Laptop GPU 32.0.16.1656 and WARP 10.0.26100.9818. Native PE, mapped PE and AOT: 108 runs, 60 complete RGBA frames, 12 queue EOF controls, 36 pre-enqueue rejections and no capability skips. Existing reader, texture publication and directory queue regressions passed. Documentation checker verified 299 links.The fixture accepts a whole single-page zlib interval for each requested logical page. Its failure controls leave the separate production offset-source question in #1198 open.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T08:52:44Z.
Review: COMMENTED
Technical peer review at commit
4f3f79a23178922dc4b9b1538123ee2cada3f6c2(LGTM, no blocking findings):Code audit:
tests/cpu/archive/directory_reader.zig:validatechecks the 16-byte header,RDS5magic, entry count bounds against bothinput.bytesand the entry-0 metadata boundary, strictly increasing logical/physical offsets, and terminal physical/logical bounds againstfile_sizeandwords[1].locatebinary-searches safely within[0, count - 1], rejects non-zlib/multi-page/zero-or-overflowing spans, and uses entry0as a safe sentinel (validated as compression type0).queueRecordchecks@addWithOverflow(start, bias)before callingenqueue_page.tests/cpu/archive/directory_gpu.cpp&tests/cpu/archive_directory_gpu_check.py:_setmode(_fileno(stdin), _O_BINARY)avoids text-mode translation on binary stdin;begin_batchlogs the file-object ID (nFileIndexHigh/Low) and defers queue creation untilenqueue_page, so validation failures exit3before any queue/trace/pixel artifacts are created. Negative controls coverinvalid count,terminal beyond EOF,missing second,EOF,wrong file,wrong record, andwrong offset.CMakeLists.txt&docs/experiments.md:EXPORT_SYMBOLS(-rdynamic) is cleanly parsed viacmake_parse_arguments; wording is title-neutral.Checks:
tests/docs_links_check.py(16 Markdown files, 299 links) passed;tests/bidi_controls_check.py(1113 files) passed;git diff --checkclean.--preset dev,archive_directory_lifted pe_map):cpu_archive_directory_gpu_warp1/1 passed (10.34s)./O2(--preset release,archive_directory_lifted pe_map):cpu_archive_directory_gpu_warp1/1 passed (9.82s).