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

Merged
marcus-4 merged 2 commits from upstream-pr/539 into main 2026-11-28 03:59:21 +00:00
marcus-4 commented 2026-11-28 01:51:11 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by marcus-4 on 2026-11-28T01:51:11Z.


Refs #532

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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5535537063 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/539). Originally posted by [marcus-4](https://github.com/marcus-4) on 2026-11-28T01:51:11Z. --- Refs #532 `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.
Olima34 commented 2026-11-28 02:09:39 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T02:09:39Z.

Review: CHANGES_REQUESTED


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: #535 (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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6095129106 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/539#pullrequestreview-6095129106). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-28T02:09:39Z. **Review:** CHANGES_REQUESTED --- 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: #535 (`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.
marcus-4 commented 2026-11-28 03:07:19 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by marcus-4 on 2026-11-28T03:07:19Z.


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

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7232807927 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/539#issuecomment-7232807927). Originally posted by [marcus-4](https://github.com/marcus-4) on 2026-11-28T03:07:19Z. --- @Olima34 done: `main` is merged in (0702abb9), keeping both lines in the switch list (`VICTORY_SKIP_PIPELINES` from #535, then the `VICTORY_TRACE_PASSES` entry with the folder note), and CI is green on that head.
LakshanSivakumar commented 2026-11-28 03:41:43 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-28T03:41:43Z.


@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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7233288958 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/539#issuecomment-7233288958). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-28T03:41:43Z. --- @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.
Olima34 commented 2026-11-28 03:59:17 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T03:59:17Z.

Review: APPROVED


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 #535's line.
  • Local check on current main (9c001aa7) + this PR + #556: 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!

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6095626817 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/539#pullrequestreview-6095626817). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-28T03:59:17Z. **Review:** APPROVED --- 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 #535's line. - **Local check on current main (9c001aa7) + this PR + #556:** `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!
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
LakshanSivakumar/Native-Victory-macOS!539
No description provided.