shaders: delegate directory input to shaders.rpf and guard against OOM #1338
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1338
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1338"
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?
@Ivankiosan on GitHub · 2026-11-24 14:58 UTC · original
Ivankiosan:shaders-cli-directory-and-oom-guard→main· +43 −1 · 1 files · 1 commits · openWhen running
xcl shaders <path>on a game installation directory (such asD:\aa\xbox),collect_filespreviously traversed the whole directory tree, queuing multi-gigabyte archives (levels.rpf76 GB,anim.rpf4.4 GB) intoInput::Files.Input::getthen attemptedstd::fs::readon those archives, causing an immediate panic (memory allocation of 4294967296 bytes failed) before any shader analysis could begin.What is in it
shaders::run: ifpathis a directory containingshaders.rpf, automatically delegates execution toshaders.rpf.collect_files: ignores non-shader extensions (exe,dll,xvd,xml,pri,png,bat) and skips files larger than 512 MiB.Input::get: checks file size withstd::fs::metadatabefore callingstd::fs::read, returningNoneif the file exceeds 512 MiB to guard against OOM.collect_files_filters_non_shader_extensionsverifying non-shader file filtering.Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13)/ MSVC 14.51.cargo test -p xcl --lib shaders: all 6 passed, 0 failed.xcl shaders "D:\aa\xbox" --top 5completes in 6.2 s on the full retail package (26,503 shaders, 44,422,713 RDNA2 instructions) without OOM.Not tested
shaders.rpf.Regression run
main:
PR head:
AI use
std::fs::readOOM panic on large game archives duringxcl shaders <dir>, implementedshaders.rpfdelegation and file size guards, authored unit test, and verified GPU smoke regression.@DavidM1911 on GitHub · 2026-11-24 15:05 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 708 passed, 0 failed, 21 ignored.Thanks!
@futurepro62 on GitHub · 2026-11-24 15:11 UTC · original
Full-suite run, since this PR has no test report yet. Tested exact head
9c9e2ca(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.collect_files_filters_non_shader_extensions.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 15:56 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodifiedmain.)Thanks!
@itsSio on GitHub · 2026-11-25 09:29 UTC · original
Tested
Independent check for #1607 on clean #1338 head
9c9e2ca5251d23224e267f8b3f1a913e88ffdbdf(no local merge). Both systems: Windows 11 Pro 26200, x64 MSVC, unoptimized dev/test.cargo build --workspace --lockedexited 0 on both;cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --nocaptureproduced:32.0.16.108832.0.16.1088Both skipped native-wave64 cases
gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware. The RTX 2080 SUPER also skippedtest_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_state(no D3D12 debug layer).collect_files_filters_non_shader_extensionspassed in both full runs.On both PCs,
xcl shadersexited 0 on each of two synthetic directory fixtures: a directory with a 64-byte syntheticshaders.rpfselected that pack instead of the loose neighbor; a directory without a pack kept one small candidate and excluded a dummy.exeand a sparse file of logical size 512 MiB + 1 byte.The RTX 2080 SUPER suite exited 101. The four failing tests and their logged errors were:
placed_title_textures_share_vram_and_preserve_pixels:cubemap extra_pages must be reused at same vatransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory:PoisonErrormove_with_locked_overlay_source_preserves_destination:move should succeed after the source handle closesI retested each in its own process on both GPUs at the clean head and its parent
930e8b49c1c2ec683d22c724a398b39111cd0e56usingcargo test -p xcl --lib --locked <fully-qualified-test> -- --exact --test-threads=1 --nocapture. Each of the 16 invocations had 1 passed / 0 failed / 0 ignored / 0 skipped. The failures did not reproduce in isolation; the parallel suite result above remains red, and this comparison does not establish whether the failures reproduce in the parent's parallel suite.Not tested
Retail titles or archives, release mode, an intentional allocation failure on the parent, or a full parallel parent suite.
AI use
Ran via Samaritan:
openai/gpt-6.2-sol): ran the recorded verification, recovered the saved logs, checked the results and drafted this report. The full model-selection history before the interrupted turn could not be verified.@S1m0ne1997 on GitHub · 2026-11-25 14:50 UTC · original
Test report for
9c9e2ca5251d23224e267f8b3f1a913e88ffdbdf(this PR's head), for #1607.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)x86_64-pc-windows-msvc, debug.cargo build --workspace, thencargo test --workspace -- --test-threads=4at the head: 752 passed, 0 failed, 41 ignored.gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64).Regression run (retail title,
scripts/smoke.ps1 -Seconds 60, release;mainbuilt from the commit in its block, this PR from its head with no changes tocrates/, both run with thescripts/smoke.ps1ofmain, which hashes the name of the game folder)main:
this PR:
Not tested
AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.