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

Manually merged
github merged 1 commit from github-bot/gh-509 into gh-pr/509/base 2026-11-28 00:23:21 +00:00 AGit
Owner

@⁠Olima34 on GitHub · 2026-11-27 23:01 UTC · original
Olima34:fix/pass-trace-placed-keys → main · +19 −1 · 1 files · 1 commits · merged 2026-11-28 00:21 UTC

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** on GitHub · 2026-11-27 23:01 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/509) `Olima34:fix/pass-trace-placed-keys` → `main` · +19 −1 · 1 files · 1 commits · merged 2026-11-28 00:21 UTC 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`.
VICTORY_TRACE_PASSES lists placed textures since c8f5d940, by keys that are no
object's address (textures::placed_key sets the top bit). At the window's last
present the dump read each key as a resource object first, and the game ended
on a segmentation fault at the first placed key (3 of 3 traced runs on an M5
Pro, after 0 to 3 PASSTEX lines). The host's own record describes such a key.

Test: the_pass_trace_reads_no_object_at_a_placed_textures_key.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 23:02:54 +00:00
github-bot changed target branch from preview/graphics-2026-11-28 to main 2026-11-27 23:55:02 +00:00
Author
Owner

@⁠Olima34 on GitHub · 2026-11-27 23:55 UTC · original

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.

**@⁠Olima34** on GitHub · 2026-11-27 23:55 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/509#issuecomment-7230511112) 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.
github-bot changed target branch from main to gh-pr/509/base 2026-11-28 00:23:20 +00:00
github manually merged commit 92669decc5 into gh-pr/509/base 2026-11-28 00:23:21 +00:00
Author
Owner

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

**@⁠LakshanSivakumar** on GitHub · 2026-11-28 00:21 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/509#pullrequestreview-6094573845) · **approved these changes**
This discussion has been locked. Commenting is limited to contributors.
No description provided.