Discover shaders and pipeline packs through file symlinks #2476

Open
github-bot wants to merge 1 commit from github-bot/gh-2476 into main AGit
Owner

@⁠DoubleD17 on GitHub · 2026-11-25 14:20 UTC · original
DoubleD17:port/fxceless-971 → main · +45 −33 · 3 files · 1 commits · open

On Marvisak main, translate, translate --cache, and pipeline pack discovery skip symbolic links to files before reading them. This adapts fxceless/victory-fork #971 to the original CLI. The shared filter accepts a link when its target is a regular file of at most 2 GiB. It preserves directory traversal and each mode's metadata handling for regular files. Synthetic tests on Windows x64 with diagnostics compared main 940d32f and candidate 9d0656c. Both translation and cache warm-up found 1/0/0 on main and 1/1/1 on the candidate across the direct file, explicit symlink, and directory containing the file symlink. Cache checks also verified persisted entries. Broken links, nested directory links, and oversized targets stayed excluded. An explicit directory link worked on both revisions. In key-listing mode, both revisions found a direct synthetic empty pack. The candidate also found it through both file-link inputs. Pack selection happened on the CPU before WARP initialization, and the test created and loaded zero pipelines.

AI-assisted.

**@⁠DoubleD17** on GitHub · 2026-11-25 14:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/2476) `DoubleD17:port/fxceless-971` → `main` · +45 −33 · 3 files · 1 commits · open On Marvisak main, `translate`, `translate --cache`, and pipeline pack discovery skip symbolic links to files before reading them. This adapts [fxceless/victory-fork #971](https://github.com/fxceless/victory-fork/pull/971) to the original CLI. The shared filter accepts a link when its target is a regular file of at most 2 GiB. It preserves directory traversal and each mode's metadata handling for regular files. Synthetic tests on Windows x64 with `diagnostics` compared main `940d32f` and candidate `9d0656c`. Both translation and cache warm-up found 1/0/0 on main and 1/1/1 on the candidate across the direct file, explicit symlink, and directory containing the file symlink. Cache checks also verified persisted entries. Broken links, nested directory links, and oversized targets stayed excluded. An explicit directory link worked on both revisions. In key-listing mode, both revisions found a direct synthetic empty pack. The candidate also found it through both file-link inputs. Pack selection happened on the CPU before WARP initialization, and the test created and loaded zero pipelines. AI-assisted.
Adapt fxceless/victory-fork#971 to cover translate, its cache warm-up,
pipeline pack discovery, and shader-info. Resolve file symlinks for
type and size checks while preserving each caller's regular-file
metadata policy and shader-info's warning for large regular files.

Thanks to avt0m4t48 for independently verifying the translate fix and
identifying the remaining shader-info gap in fxceless/victory-fork#971.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:06:58 +00:00
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-25 15:42 UTC · original

Independent local validation for PR #2476 (Windows, Rust 1.100.0/MSVC, head 73ef2eb, no game data): cargo test --locked -p victory --bins -> 10 tests passed, 0 failed, exit 0. CPU-only regression run; synthetic symlink discovery scenario not replayed. AI-assisted (Hy4 flash). GPU/driver N/A (CPU tooling).

**@⁠cloph-dsp** on GitHub · 2026-11-25 15:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/2476#issuecomment-7167262424) Independent local validation for PR #2476 (Windows, Rust 1.100.0/MSVC, head 73ef2eb, no game data): `cargo test --locked -p victory --bins` -> 10 tests passed, 0 failed, exit 0. CPU-only regression run; synthetic symlink discovery scenario not replayed. AI-assisted (Hy4 flash). GPU/driver N/A (CPU tooling).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:54 UTC · original

Automated triage for the maintainers.

This moves the four copies of the input walk in apps/victory (shader::run, translate::run, translate::warm, prebuild::run) into one shader_files filter that also accepts a symlink whose target is a regular file of at most MAX_FILE, so linked shader files and packs are no longer skipped. By reading, each caller keeps its old metadata policy (the three CLI modes still accept an entry whose metadata cannot be read, prebuild still rejects it, shader::run still prints "skipping large file"), and links to directories are still not traversed. CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/2476#issuecomment-7167419436) <!-- victory-triage v1 head=73ef2ebaaf327c5b0a43d5ba293b8a301eb33b20 verdict=merge-candidate at=2026-11-25T15:53:19Z --> Automated triage for the maintainers. This moves the four copies of the input walk in `apps/victory` (`shader::run`, `translate::run`, `translate::warm`, `prebuild::run`) into one `shader_files` filter that also accepts a symlink whose target is a regular file of at most `MAX_FILE`, so linked shader files and packs are no longer skipped. By reading, each caller keeps its old metadata policy (the three CLI modes still accept an entry whose metadata cannot be read, prebuild still rejects it, `shader::run` still prints "skipping large file"), and links to directories are still not traversed. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 16:54 UTC · original

Semantics preserved correctly: for regular files the same is_file && len <= MAX_FILE test; for symlinks fs::metadata follows the link so a symlink to a file is now included where file_type().is_file() used to drop it — that's the advertised change. allow_missing_metadata keeps each caller's old policy (translate/warm/shader-info included them, prebuild skipped). Large-file notice only where it was before.

One gap: a symlink to a directory is still skipped — metadata.is_file() fails and WalkDir doesn't follow dir links, so game_dir trees assembled via directory junctions still aren't scanned. If that's the actual layout motivation, follow_links(true) (plus cycle protection) is the real fix; file-level symlinks alone may be enough for the reported case — worth stating which scenario prompted this.

**@⁠kotekompotek** on GitHub · 2026-11-25 16:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/2476#issuecomment-7168700141) Semantics preserved correctly: for regular files the same `is_file && len <= MAX_FILE` test; for symlinks `fs::metadata` follows the link so a symlink *to a file* is now included where `file_type().is_file()` used to drop it — that's the advertised change. `allow_missing_metadata` keeps each caller's old policy (translate/warm/shader-info included them, prebuild skipped). Large-file notice only where it was before. One gap: a symlink *to a directory* is still skipped — `metadata.is_file()` fails and WalkDir doesn't follow dir links, so `game_dir` trees assembled via directory junctions still aren't scanned. If that's the actual layout motivation, `follow_links(true)` (plus cycle protection) is the real fix; file-level symlinks alone may be enough for the reported case — worth stating which scenario prompted this.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2476/head:github-bot/gh-2476'
git switch 'github-bot/gh-2476'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2476'
git switch 'github-bot/gh-2476'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2476'
git switch 'github-bot/gh-2476'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2476'
git switch 'main'
git merge --squash 'github-bot/gh-2476'
git switch 'main'
git merge --ff-only 'github-bot/gh-2476'
git switch 'main'
git merge 'github-bot/gh-2476'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2476
No description provided.