compute: publish every compute pack record across numbered parts #3486
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3486
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3484"
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?
@Not-Saii on GitHub · 2026-11-29 17:21 UTC · original
Not-Saii:claude/compute-pack-parts-3473-916534→main· +311 −35 · 6 files · 2 commits · merged 2026-11-30 08:45 UTCFixes #3475. Follows #3091.
compile_dxil --prepare-compute-packleft out every record past 256 MiB. A pack is now written as numbered parts, each under that limit, so every record is published. The shared cachelookupand its 256 MiB cap are unchanged.Writer (
build_compute_frontend_pack)compute-<entry>.pack. Later parts arecompute-<entry>.<n>.pack.pack_version. Part n > 0 is published under the digest ofpack_versionand its payload's SHA-256, and the previous part names that id. So the existinglookuprefuses a missing, stale or swapped part without hashing a payload twice.invalid compute pack size.pack_versionmoves toprepared-2.part_limit, defaultcompute_pack_part_limit). Only the test lowers it. The command line is unchanged.Reader (
ComputeFrontendPack::load; the runtime caller is unchanged)X2W_NATIVE_COMPUTE_PACKstill names part 0.Tests (new
native_compute_pack_parts,tests/cmake/native_compute_pack_parts.cmake)The fixture is 13 source-built requests: 1 prepared and 12 refused. The prepared record sits between refused ones in the sorted order.
native_compute_pack_checkgains three modes:--build(the writer with a lowered limit),--same(per-key comparison of two packs) and--old(writes aprepared-1file).Positive.
prepared=1 unsupported=12 errors=0.other=0).--samegives the samelookupresult for all 13 keys as the one-part pack built bycompile_dxilwith no limit.Single record over the limit (limit − 1):
prepared=0 unsupported=12 errors=1, with exactly oneinvalid compute pack size.Negative controls. Each is refused with the stated message, and the restored pack loads again:
missing, stale or damaged compute packmissing, stale or damaged compute packinvalid compute pack recordtrailing compute pack datainvalid compute pack part countinvalid compute pack partstale compute pack part, and--buildremoves itprepared-1pack under this build's revisionmissing, stale or damaged compute pack, and a rebuild loadsRevert controls (run locally, not committed):
--buildgivesprepared=0 unsupported=12 errors=1, with the crossing record reported asinvalid compute pack sizeand left out.prepared-2reverted toprepared-1: theprepared-1file passes the version check and is parsed as the new layout. It fails only because a request-key word exceeds the count bound (invalid frontend cache count).Result: 2/2 passed (
native_compute_pack,native_compute_pack_parts). Windows 11 build 26300, MSVC (VS 2022, dev preset), Windows SDK 10.0.26100, Python 3.12. No GPU used.native_compute_pack_hardwarewas not run. The PR check skipsnative_*tests, so this local run is the evidence for both until a full workflow run.Measurement. Counts only. None of my own captures was rerun. The synthetic test above is the evidence. A rerun of the 2,689-request set from #3474, before and after, would show the 28 left-out records published as a second part.
Interaction with #3474 (open). Both change
build_compute_frontend_pack.unsigned jobs = 1as the fourth parameter, and this PR addssize_t part_limitthere. After both, the checker's--buildcall must passjobsexplicitly.AI-assisted.
🤖 Generated with Claude Code
@Leyukaka on GitHub · 2026-11-29 17:45 UTC · original · approved these changes
Approve at
8d25453a. Reviewed by reading the diff only; nothing was built or run here.Checked: part naming and the split are deterministic (sorted requests, greedy); a record goes into exactly one part, none lost or duplicated at a boundary; the single-record bound
part_limit - 72 - 80keeps every file withinlookup's 256 MiB cap; the next-id chain and the part-past-the-count check refuse a missing, stale or swapped part; the reader and theprepared-2bump refuse old packs; nothing changes whenX2W_NATIVE_COMPUTE_PACKis unset.Should:
tests/native_compute_pack_check.cpp:30passes the limit as the 4th positional argument, where #3474 addsunsigned jobs = 1. If the rebase misses that call it still compiles (size_ttounsigned) and the limit becomes the thread count. Suggest landing #3474 first, then the signature(requests, cache, entry, jobs, part_limit)with the test passing both.fs::removethat fails after a later part has been replaced leaves no loadable pack: the old part 0 then names a part whose id differs. That is safe (the load is refused and every request is a miss), but the doc only covers "every input fails"; one sentence would do.Nits:
tests/native_compute_pack_check.py:177matchesstale compute pack partas a substring, while the PR body says every refusal is matched against the whole stderr line.lookupcompares a part's stored id with the id named by the previous part, but the id is not re-derived from the stored checksum. Hardening only.@lukaslw-lab on GitHub · 2026-11-30 00:29 UTC · original
Thanks for taking #3475. A real-data point for it: 4,352 compute requests from one local capture, through the current single-file writer (with #3474), gave 887 prepared, 2,742 unsupported and 723 left out as
invalid compute pack size.Agreed with Leyukaka on the order: #3474 first, then
(requests, cache, entry, jobs, part_limit)here.