gpu(native): the pass trace reads no object at a placed texture's key (preview branch) #509

Merged
Olima34 merged 1 commit from upstream-pr/509 into main 2026-11-28 00:21:43 +00:00
Olima34 commented 2026-11-27 23:01:01 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T23:01:01Z.


Against preview/graphics-2026-11-28, not main: main doesn't have this bug.

What crashed. On the preview branch, c8f5d940 ("trace placed mips") makes the pass trace list placed textures too, by textures::placed_key. That key is a number with the top bit set, and it's no object's address. At the window's last present, the trace dump read every key as a resource object first. So VICTORY_TRACE_PASSES ended the game on a segmentation fault at the first placed key: 3 of 3 traced runs on an M5 Pro, after 0–3 PASSTEX lines.

Fix (1 file, +19/-1, crates/victory-gpu/src/native/glue.rs). pass_info(key, host) takes a placed key's description from the host's own record only.

Test. the_pass_trace_reads_no_object_at_a_placed_textures_key: without the fix the test binary aborts (SIGABRT); with it, it passes.

In game. With the fix, the same trace wrote 514 and 524 PASSTEX lines, and the run ended on its time limit.

Checks: victory-hle, victory, victory-gpu (413) and xtask tests pass. Windows clippy on the workspace is clean with -D warnings, and cargo xtask policy passes. There's no docs change: the trace behaves as before, it just no longer crashes.

It belongs with c8f5d940 when that lands on main.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5534193146 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/509). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-27T23:01:01Z. --- Against `preview/graphics-2026-11-28`, not `main`: `main` doesn't have this bug. **What crashed.** On the preview branch, c8f5d940 ("trace placed mips") makes the pass trace list placed textures too, by `textures::placed_key`. That key is a number with the top bit set, and it's no object's address. At the window's last present, the trace dump read every key as a resource object first. So `VICTORY_TRACE_PASSES` ended the game on a segmentation fault at the first placed key: 3 of 3 traced runs on an M5 Pro, after 0–3 PASSTEX lines. **Fix** (1 file, +19/-1, `crates/victory-gpu/src/native/glue.rs`). `pass_info(key, host)` takes a placed key's description from the host's own record only. **Test.** `the_pass_trace_reads_no_object_at_a_placed_textures_key`: without the fix the test binary aborts (SIGABRT); with it, it passes. **In game.** With the fix, the same trace wrote 514 and 524 PASSTEX lines, and the run ended on its time limit. **Checks:** victory-hle, victory, victory-gpu (413) and xtask tests pass. Windows clippy on the workspace is clean with `-D warnings`, and `cargo xtask policy` passes. There's no docs change: the trace behaves as before, it just no longer crashes. It belongs with c8f5d940 when that lands on `main`.
Olima34 commented 2026-11-27 23:55:32 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T23:55:32Z.


Retargeted from preview/graphics-2026-11-28 to main: the preview branch is on main since 86cefd22, and so is the bug (it came with c8f5d940). The branch's base, b3c1a1b0, is in main and the PR merges cleanly. The same change replayed on 86cefd22 (identical diff, only line offsets differ) passes cargo test -p victory-hle -p victory -p victory-gpu -p xtask (victory-gpu 428 passed, 6 ignored), Windows clippy -D warnings and cargo xtask policy. Without it, any VICTORY_TRACE_PASSES run on main ends in a segfault at the first placed texture's key.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7230511112 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/509#issuecomment-7230511112). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-27T23:55:32Z. --- Retargeted from `preview/graphics-2026-11-28` to `main`: the preview branch is on main since `86cefd22`, and so is the bug (it came with c8f5d940). The branch's base, b3c1a1b0, is in main and the PR merges cleanly. The same change replayed on `86cefd22` (identical diff, only line offsets differ) passes `cargo test -p victory-hle -p victory -p victory-gpu -p xtask` (victory-gpu 428 passed, 6 ignored), Windows clippy `-D warnings` and `cargo xtask policy`. Without it, any `VICTORY_TRACE_PASSES` run on main ends in a segfault at the first placed texture's key.
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!509
No description provided.