gpu(native): image dumps make their folder and log a write that fails (#532) #543

Manually merged
github merged 2 commits from github-bot/gh-539 into gh-pr/539/base 2026-11-28 04:04:56 +00:00 AGit
Owner

@⁠marcus-4 on GitHub · 2026-11-28 01:51 UTC · original
marcus-4:fix/trace-passes-dump-folder → main · +36 −6 · 2 files · 2 commits · merged 2026-11-28 03:59 UTC

Refs #536

VICTORY_TRACE_PASSES=<dir>,... wrote each .ppm with std::fs::write into <dir> without making the folder and threw the error away, so a folder that did not exist gave a run with PASS/PASSTEX lines and no pictures. VICTORY_DUMP_TARGETS and VICTORY_DUMP_TITLE (same file, same pattern) had the same problem.

  • One helper, glue::write_dump, makes the folder (create_dir_all) and writes the image. The first write that fails is logged as a warning, and later ones are not, so a bad folder costs one line, not one line per image.
  • All five dump writes in glue.rs use it.
  • Test: a_dump_makes_its_folder_and_reports_a_write_it_cannot_make (no GPU). It writes into a nested folder that does not exist yet, then checks that a write under a file fails without a panic.
  • docs/native-host.md: the VICTORY_TRACE_PASSES entry says the folder is made.

Checked locally (M1 Pro, macOS 27.2): clippy for x86_64-pc-windows-gnullvm with -D warnings, cargo xtask policy, cargo test -p victory-gpu -p xtask (447 + 6 passed). No game run: this only changes where images are written.

**@⁠marcus-4** on GitHub · 2026-11-28 01:51 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/539) `marcus-4:fix/trace-passes-dump-folder` → `main` · +36 −6 · 2 files · 2 commits · merged 2026-11-28 03:59 UTC Refs #536 `VICTORY_TRACE_PASSES=<dir>,...` wrote each `.ppm` with `std::fs::write` into `<dir>` without making the folder and threw the error away, so a folder that did not exist gave a run with `PASS`/`PASSTEX` lines and no pictures. `VICTORY_DUMP_TARGETS` and `VICTORY_DUMP_TITLE` (same file, same pattern) had the same problem. - One helper, `glue::write_dump`, makes the folder (`create_dir_all`) and writes the image. The first write that fails is logged as a warning, and later ones are not, so a bad folder costs one line, not one line per image. - All five dump writes in `glue.rs` use it. - Test: `a_dump_makes_its_folder_and_reports_a_write_it_cannot_make` (no GPU). It writes into a nested folder that does not exist yet, then checks that a write under a file fails without a panic. - `docs/native-host.md`: the `VICTORY_TRACE_PASSES` entry says the folder is made. Checked locally (M1 Pro, macOS 27.2): clippy for `x86_64-pc-windows-gnullvm` with `-D warnings`, `cargo xtask policy`, `cargo test -p victory-gpu -p xtask` (447 + 6 passed). No game run: this only changes where images are written.
VICTORY_TRACE_PASSES (and VICTORY_DUMP_TARGETS, VICTORY_DUMP_TITLE) wrote
each .ppm without creating the folder and ignored the error, so a folder
that did not exist gave a run with PASS lines and no pictures. One helper
now makes the folder first and warns once on the first failed write.

Refs #532
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 01:54:01 +00:00
Author
Owner

@⁠Olima34 on GitHub · 2026-11-28 02:09 UTC · original · requested changes

Thanks @⁠marcus-4. We read the whole diff (ba5a77c9) while helping the maintainer clear the queue, and it holds up: one write_dump helper that makes the folder and warns once on the first failed write, used by all three dump switches, with a test for both cases.

The only blocker: #539 (VICTORY_SKIP_PIPELINES on macOS) just merged, and it adds a line next to the VICTORY_TRACE_PASSES entry in the switch list of docs/native-host.md, so this branch now conflicts there. Could you merge current main into the branch and keep both lines? Once CI is green on the new head, we'll merge it.

**@⁠Olima34** on GitHub · 2026-11-28 02:09 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/539#pullrequestreview-6095129106) · **requested changes** Thanks @⁠marcus-4. We read the whole diff (ba5a77c9) while helping the maintainer clear the queue, and it holds up: one `write_dump` helper that makes the folder and warns once on the first failed write, used by all three dump switches, with a test for both cases. The only blocker: #539 (`VICTORY_SKIP_PIPELINES` on macOS) just merged, and it adds a line next to the `VICTORY_TRACE_PASSES` entry in the switch list of `docs/native-host.md`, so this branch now conflicts there. Could you merge current `main` into the branch and keep both lines? Once CI is green on the new head, we'll merge it.
Author
Owner

@⁠marcus-4 on GitHub · 2026-11-28 03:07 UTC · original

@⁠Olima34 done: main is merged in (0702abb9), keeping both lines in the switch list (VICTORY_SKIP_PIPELINES from #539, then the VICTORY_TRACE_PASSES entry with the folder note), and CI is green on that head.

**@⁠marcus-4** on GitHub · 2026-11-28 03:07 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/539#issuecomment-7232807927) @⁠Olima34 done: `main` is merged in (0702abb9), keeping both lines in the switch list (`VICTORY_SKIP_PIPELINES` from #539, then the `VICTORY_TRACE_PASSES` entry with the folder note), and CI is green on that head.
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-28 03:40 UTC · original · approved these changes

**@⁠LakshanSivakumar** on GitHub · 2026-11-28 03:40 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/539#pullrequestreview-6095504693) · **approved these changes**
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-28 03:41 UTC · original

@⁠Olima34 main is merged in (0702abb9) and CI is green, and I have approved it. Your change request is the only thing still blocking the merge. Could you approve or dismiss it? Then this can go in.

**@⁠LakshanSivakumar** on GitHub · 2026-11-28 03:41 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/539#issuecomment-7233288958) @⁠Olima34 main is merged in (0702abb9) and CI is green, and I have approved it. Your change request is the only thing still blocking the merge. Could you approve or dismiss it? Then this can go in.
github-bot changed target branch from main to gh-pr/539/base 2026-11-28 04:04:56 +00:00
github manually merged commit 0702abb9f4 into gh-pr/539/base 2026-11-28 04:04:56 +00:00
Author
Owner

@⁠Olima34 on GitHub · 2026-11-28 03:59 UTC · original · approved these changes

Check report on the updated head 0702abb9 (helping the maintainer clear the queue):

  • CI: check and macos-scripts green.
  • Read: the whole diff again. The new head only merges main; the change is the same write_dump helper as before (makes the folder, warns once), used by VICTORY_DUMP_TITLE, VICTORY_DUMP_TARGETS and VICTORY_TRACE_PASSES, with its test. The docs conflict is resolved, keeping #539's line.
  • Local check on current main (9c001aa7) + this PR + #560: victory-gpu tests pass 2/2 (arm64, 449), Windows clippy (-D warnings) clean, cargo xtask policy ok.
  • Not checked: no game run.

Thanks @⁠marcus-4!

**@⁠Olima34** on GitHub · 2026-11-28 03:59 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/539#pullrequestreview-6095626817) · **approved these changes** Check report on the updated head 0702abb9 (helping the maintainer clear the queue): - **CI:** `check` and `macos-scripts` green. - **Read:** the whole diff again. The new head only merges main; the change is the same `write_dump` helper as before (makes the folder, warns once), used by `VICTORY_DUMP_TITLE`, `VICTORY_DUMP_TARGETS` and `VICTORY_TRACE_PASSES`, with its test. The docs conflict is resolved, keeping #539's line. - **Local check on current main (9c001aa7) + this PR + #560:** `victory-gpu` tests pass 2/2 (arm64, 449), Windows clippy (`-D warnings`) clean, `cargo xtask policy` ok. - **Not checked:** no game run. Thanks @⁠marcus-4!
This discussion has been locked. Commenting is limited to contributors.
No description provided.