GPU diagnostics: VICTORY_CAPTURE saves nothing when its folder doesn't exist yet (fix on a branch) #792

Open
opened 2026-11-26 04:13:58 +00:00 by github-bot · 3 comments
Owner

@⁠JFIREonFIRE on GitHub · 2026-11-24 11:01 UTC · original

AI-assisted (Claude Code). Tested on my own machine.

Pull requests are collaborator-only, so I'm offering this as a branch. A collaborator is welcome to open a PR from it:

https://github.com/JFIREonFIRE/VIctory/tree/fix/capture-creates-folder (one commit, 1e82209 on main ffe310e, capture.rs only)

The problem

VICTORY_CAPTURE must name a folder that already exists. If it doesn't, every frame fails with frame not saved ... The system cannot find the path specified. (os error 3) and the run saves nothing. VICTORY_DUMP_TARGETS writes into the same folder, so it is affected too.

The change

The folder and any missing parents are created when capturing starts. If that fails, a capture folder not made warning is logged.

Tested

  • New test a_missing_capture_folder_is_made.
  • Both of CI's clippy configurations pass. cargo test --workspace --locked passes (342). cargo xtask policy passes.
  • Ran the title (1.0.2.1, diag build, RTX 3090) with VICTORY_CAPTURE set to a nested folder that didn't exist:
    • Before the fix: every frame logged frame not saved.
    • After the fix: the folder was created and 10 frames were saved.

No game data in the change.

**@⁠JFIREonFIRE** on GitHub · 2026-11-24 11:01 UTC · [original](https://github.com/Marvisak/VIctory/issues/792) *AI-assisted (Claude Code). Tested on my own machine.* Pull requests are collaborator-only, so I'm offering this as a branch. A collaborator is welcome to open a PR from it: https://github.com/JFIREonFIRE/VIctory/tree/fix/capture-creates-folder (one commit, `1e82209` on `main` `ffe310e`, `capture.rs` only) ## The problem `VICTORY_CAPTURE` must name a folder that already exists. If it doesn't, every frame fails with `frame not saved ... The system cannot find the path specified. (os error 3)` and the run saves nothing. `VICTORY_DUMP_TARGETS` writes into the same folder, so it is affected too. ## The change The folder and any missing parents are created when capturing starts. If that fails, a `capture folder not made` warning is logged. ## Tested - New test `a_missing_capture_folder_is_made`. - Both of CI's clippy configurations pass. `cargo test --workspace --locked` passes (342). `cargo xtask policy` passes. - Ran the title (1.0.2.1, diag build, RTX 3090) with `VICTORY_CAPTURE` set to a nested folder that didn't exist: - Before the fix: every frame logged `frame not saved`. - After the fix: the folder was created and 10 frames were saved. No game data in the change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:58 +00:00
Author
Owner

@⁠nopsled0x on GitHub · 2026-11-24 14:58 UTC · original

I checked fix/capture-creates-folder (1e82209, on top of ffe310e) on Windows 10, debug build:

  • cargo test -p victory-gpu --locked --features diagnostics -- capture: 3 passed, 0 failed, including capture::tests::a_missing_capture_folder_is_made. The capture module is only compiled with --features diagnostics, so the test does not run without it.
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings, with and without --features diagnostics: clean.
  • From reading the diff (not tested beyond the unit test above): made runs inside the OnceLock initializer, so the capture folder not made warning is logged at most once per process. If the folder cannot be created, the path is still returned, as before, so only the warning is new. VICTORY_DUMP_TARGETS takes its folder from the same folder(), so it gets the same fix.
  • Not covered by the test (read, not run): a path that is already a file would only log the warning, and an empty VICTORY_CAPTURE logs nothing, because create_dir_all("") returns Ok. A relative path is resolved against the game process's working directory.

Not verified: cargo test --workspace, cargo xtask policy, rustfmt, workspace-wide clippy, the capture end to end on a real run (the 10 saved frames in the description), or VICTORY_DUMP_TARGETS in practice.

AI-assisted verification (Claude); tests were run locally by me.

**@⁠nopsled0x** on GitHub · 2026-11-24 14:58 UTC · [original](https://github.com/Marvisak/VIctory/issues/792#issuecomment-7135247200) I checked `fix/capture-creates-folder` (1e82209, on top of ffe310e) on Windows 10, debug build: - `cargo test -p victory-gpu --locked --features diagnostics -- capture`: 3 passed, 0 failed, including `capture::tests::a_missing_capture_folder_is_made`. The `capture` module is only compiled with `--features diagnostics`, so the test does not run without it. - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`, with and without `--features diagnostics`: clean. - From reading the diff (not tested beyond the unit test above): `made` runs inside the `OnceLock` initializer, so the `capture folder not made` warning is logged at most once per process. If the folder cannot be created, the path is still returned, as before, so only the warning is new. `VICTORY_DUMP_TARGETS` takes its folder from the same `folder()`, so it gets the same fix. - Not covered by the test (read, not run): a path that is already a file would only log the warning, and an empty `VICTORY_CAPTURE` logs nothing, because `create_dir_all("")` returns `Ok`. A relative path is resolved against the game process's working directory. Not verified: `cargo test --workspace`, `cargo xtask policy`, `rustfmt`, workspace-wide clippy, the capture end to end on a real run (the 10 saved frames in the description), or `VICTORY_DUMP_TARGETS` in practice. _AI-assisted verification (Claude); tests were run locally by me._
Author
Owner

@⁠jamesn-xt on GitHub · 2026-11-24 16:13 UTC · original

Independently reproduced this on Windows 11 / RTX 4080: a nonexistent capture directory lost all requested PNGs. After a local directory-creation change and diagnostics rebuild, a previously nonexistent directory was created and frames were saved in a bounded WARP run.

I submitted the minimal alternative as #1146. Its description credits this issue and the existing JFIREonFIRE branch; please prefer whichever implementation fits. This does not claim to fix title rendering. Validation: workspace 342 passed / 6 ignored; diagnostics GPU tests 53 passed / 1 ignored; both workspace CI Clippy configurations and the asset-policy check passed. No retail logs or captures attached.

**@⁠jamesn-xt** on GitHub · 2026-11-24 16:13 UTC · [original](https://github.com/Marvisak/VIctory/issues/792#issuecomment-7137327141) Independently reproduced this on Windows 11 / RTX 4080: a nonexistent capture directory lost all requested PNGs. After a local directory-creation change and diagnostics rebuild, a previously nonexistent directory was created and frames were saved in a bounded WARP run. I submitted the minimal alternative as #1146. Its description credits this issue and the existing JFIREonFIRE branch; please prefer whichever implementation fits. This does not claim to fix title rendering. Validation: workspace 342 passed / 6 ignored; diagnostics GPU tests 53 passed / 1 ignored; both workspace CI Clippy configurations and the asset-policy check passed. No retail logs or captures attached.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 03:53 UTC · original

Automated triage for the maintainers. Fixed in main by #1146 ("GPU diagnostics: create missing capture output directories"), which credits this issue. The frame writer in crates/victory-gpu/src/capture.rs now calls create_dir_all on the capture folder before it writes each PNG. Proposed for closing as fixed in main. It will be closed in 48 hours unless the reporter replies or a maintainer removes the label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 03:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/792#issuecomment-7152331097) <!-- victory-issue-triage v1 verdict=proposed-close seen=2026-11-24T16:13:52Z at=2026-11-25T03:53:11Z --> Automated triage for the maintainers. Fixed in `main` by #1146 ("GPU diagnostics: create missing capture output directories"), which credits this issue. The frame writer in `crates/victory-gpu/src/capture.rs` now calls `create_dir_all` on the capture folder before it writes each PNG. Proposed for closing as fixed in `main`. It will be closed in 48 hours unless the reporter replies or a maintainer removes the label. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
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#792
No description provided.