gpu(native): drop a command at unmapped title memory alone, not its whole piece #102

Merged
Olima34 merged 1 commit from upstream-pr/102 into main 2026-11-26 17:05:02 +00:00
Olima34 commented 2026-11-26 15:25:00 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-26T15:25:00Z.


What this changes

Refs #15. In your #100 run the story load still logged 229 "title address … is not in a mapped pool" warnings. Each of them comes from native/title.rs's "a piece of title work was refused": in NativeHost::execute, a command whose prep fails that way falls to Err(e) => return Err(e), so the whole ExecuteCommandLists piece is refused. That drops the piece's valid dispatches, copies and value writes too, and the title then reads their destination buffers as they were before. That fits the float-pattern data later read as pointers.

Such a command is now dropped by itself, the way #57 drops a draw or dispatch with an unset root parameter or no target:

  • It is still not encoded, so an unreachable address never reaches the GPU (the intent of the old unmapped_title_address_is_refused, "an error at submission, not a GPU fault").
  • The rest of the piece runs. A dropped command still ends the pass it would have ended, as for the other dropped kinds.
  • It is counted per host (NativeHost::unmapped). Unlike the two #57 kinds, the first one warns without a switch, as the refused piece did, and each one is logged at debug level with its address, so nothing you used for diagnosis is lost.

This applies to every command kind that resolves title memory in prep: root views of draws and dispatches, vertex and index buffers, copies, and fills and value writes. Other errors still refuse the piece. On the console that memory is reachable, so running the rest of the piece is closer to it than dropping everything; the dropped command itself is lost either way.

It doesn't fix why those addresses are outside the pool table. #100 covers the upload blocks; the other candidates I found (host-heap XMemAllocDefault/ID3D12Heap memory, fence GPU addresses, ranges spanning two pools) need a run with the addresses to rank, and I'll follow up there.

How it was tested

  • victory-gpu on arm64 with the Metal Shader Converter (166 tests, the native tests 3 times): unmapped_title_address_is_refused becomes a_command_at_unmapped_title_memory_is_dropped_alone. On Metal, a dispatch and a copy at unmapped memory are dropped (unmapped() == 2, the copy's destination untouched), and the value writes before and after them and the valid dispatch between them run. With main's execute it fails: the piece is refused with "title address 0xdead0000+0x1 is not in a mapped pool".
  • arm64 cargo test --workspace (684 tests)
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings, also with --all-features
  • cargo xtask policy
  • Ran the game: not done, no copy of it here

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • No guesses about console behaviour
  • No new diagnostics switch (the first drop warns as the refused piece did; each one at debug level)
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6629853677 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/102). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-26T15:25:00Z. --- ## What this changes Refs #15. In your #100 run the story load still logged 229 "title address … is not in a mapped pool" warnings. Each of them comes from `native/title.rs`'s "a piece of title work was refused": in `NativeHost::execute`, a command whose `prep` fails that way falls to `Err(e) => return Err(e)`, so the whole `ExecuteCommandLists` piece is refused. That drops the piece's valid dispatches, copies and value writes too, and the title then reads their destination buffers as they were before. That fits the float-pattern data later read as pointers. Such a command is now dropped by itself, the way #57 drops a draw or dispatch with an unset root parameter or no target: - It is still not encoded, so an unreachable address never reaches the GPU (the intent of the old `unmapped_title_address_is_refused`, "an error at submission, not a GPU fault"). - The rest of the piece runs. A dropped command still ends the pass it would have ended, as for the other dropped kinds. - It is counted per host (`NativeHost::unmapped`). Unlike the two #57 kinds, the first one warns without a switch, as the refused piece did, and each one is logged at debug level with its address, so nothing you used for diagnosis is lost. This applies to every command kind that resolves title memory in `prep`: root views of draws and dispatches, vertex and index buffers, copies, and fills and value writes. Other errors still refuse the piece. On the console that memory is reachable, so running the rest of the piece is closer to it than dropping everything; the dropped command itself is lost either way. It doesn't fix why those addresses are outside the pool table. #100 covers the upload blocks; the other candidates I found (host-heap `XMemAllocDefault`/`ID3D12Heap` memory, fence GPU addresses, ranges spanning two pools) need a run with the addresses to rank, and I'll follow up there. ## How it was tested - [x] `victory-gpu` on arm64 with the Metal Shader Converter (166 tests, the native tests 3 times): `unmapped_title_address_is_refused` becomes `a_command_at_unmapped_title_memory_is_dropped_alone`. On Metal, a dispatch and a copy at unmapped memory are dropped (`unmapped() == 2`, the copy's destination untouched), and the value writes before and after them and the valid dispatch between them run. With `main`'s `execute` it fails: the piece is refused with "title address 0xdead0000+0x1 is not in a mapped pool". - [x] arm64 `cargo test --workspace` (684 tests) - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings`, also with `--all-features` - [x] `cargo xtask policy` - [ ] Ran the game: not done, no copy of it here ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included - [x] No guesses about console behaviour - [x] No new diagnostics switch (the first drop warns as the refused piece did; each one at debug level)
LakshanSivakumar commented 2026-11-26 15:55:36 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T15:55:36Z.

Review: DISMISSED


Dropping the one command at unmapped title memory, rather than refusing the whole ExecuteCommandLists piece, matches how #57 treats an unset root or missing target. The new test checks that the surrounding value writes and the second dispatch still run, and that the bad copy does not. CI is green. Approving.

One thing for the record: this stops the piece being lost, but it does not explain why a command named unmapped memory. Keep the counter and the first-time warning, they will be useful for the prologue crash investigation.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6077113216 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/102#pullrequestreview-6077113216). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T15:55:36Z. **Review:** DISMISSED --- Dropping the one command at unmapped title memory, rather than refusing the whole ExecuteCommandLists piece, matches how #57 treats an unset root or missing target. The new test checks that the surrounding value writes and the second dispatch still run, and that the bad copy does not. CI is green. Approving. One thing for the record: this stops the piece being lost, but it does not explain why a command named unmapped memory. Keep the counter and the first-time warning, they will be useful for the prologue crash investigation.
Olima34 commented 2026-11-26 16:59:47 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-26T16:59:47Z.


Rebased on main for 8765326 (one test conflict: kept your indirect dispatch test next to this one). An indirect record at unmapped memory takes the same path: resolve fails in the command's prep, so that command is dropped alone. victory-gpu native tests (170), Windows clippy and policy pass.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7198356230 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/102#issuecomment-7198356230). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-26T16:59:47Z. --- Rebased on main for 8765326 (one test conflict: kept your indirect dispatch test next to this one). An indirect record at unmapped memory takes the same path: `resolve` fails in the command's prep, so that command is dropped alone. victory-gpu native tests (170), Windows clippy and policy pass.
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!102
No description provided.