Port 1 opens on Windows 11 before 24H2: OpenExistingHeapFromAddress without ID3D12Device13 #3962

Closed
danielsteman wants to merge 2 commits from upstream-pr/3962 into main
danielsteman commented 2026-11-30 13:06:33 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by danielsteman on 2026-11-30T13:06:33Z.


Fixes #3938.

Credit: the fix and every measurement below come from @ntrglcrn in #3938. This PR turns their local change into a patch and credits them as co-author on the commit.

Problem

With VICTORY_PORT_CONSTANTS=1, port::open_region opened the title's graphics memory only through ID3D12Device13::OpenExistingHeapFromAddress1. That interface exists only on Windows 11 24H2 and later. On 23H2 the cast fails with E_NOINTERFACE, so every region quietly falls back to a host copy:

renderer port 1: title memory not in place, a copy as before ... why="refused by the host: ... (0x80004002)"

Change

inplace::open now handles From::Part itself:

  1. It tries ID3D12Device13::OpenExistingHeapFromAddress1, as before.
  2. If Device13 is missing (Windows 11 before 24H2) or refuses, and the part is its whole allocation, it opens it with ID3D12Device3::OpenExistingHeapFromAddress, which every Windows has.

Port 1's view of the stretch is always a whole allocation (MapViewOfFile), so it qualifies, and port::open_region needs no branch of its own. place_part (VICTORY_INPLACE) and the census get the same fallback whenever their part is a whole allocation. The rules at the top of inplace.rs now record that the older call takes a whole committed view of a section.

Reporter's results (RTX 3080, Windows 11 Pro 23H2 build 22631, driver 621.24, Series X profile)

  • The port opened all 185 MB of the title's graphics memory, with no errors, crashes or artifacts across 4 sessions.
  • Copies per frame: 38 → 25 ms.
  • CPU frame preparation: 71 → 53 ms.
  • Median fps: 11 → 11.7.

Test

inplace::tests::warp_a_whole_view_opens_without_device13 runs on WARP. It calls open_part with the newer call switched off, which is the path a host without Device13 takes, whatever the runner has. The test checks:

  • a whole committed view of a SEC_RESERVE section opens;
  • the card reads the view's bytes and its writes show up in the view;
  • a part inside the view is refused.

Run on Windows (windows-latest, this PR's head, on my fork while upstream CI waits for approval: run 46432250492):

test inplace::tests::warp_a_whole_view_opens_without_device13 ... ok
test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 969 filtered out

These are all of port::tests and inplace::tests, including the WARP probe, whose output shows the runner made a WARP device. cargo clippy -p victory-gpu --all-targets passes.

Not green, and not from this PR:

  • The workspace clippy gate (-D warnings) fails on main at this PR's base 41adb551.
  • cargo test --workspace stops in victory-formats: 3 bcpack::tests::oracle_parity_* BC7 tests fail. This PR does not touch that crate. Because cargo stopped there, the rest of victory-gpu's suite did not run in that step.

Review notes: the fallback first sat in port.rs and ran only when the Device13 cast failed. A review moved it into inplace::open, so it also covers a refusal and every From::Part caller.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5565864200 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3962). Originally posted by [danielsteman](https://github.com/danielsteman) on 2026-11-30T13:06:33Z. --- Fixes #3938. **Credit:** the fix and every measurement below come from @ntrglcrn in #3938. This PR turns their local change into a patch and credits them as co-author on the commit. ## Problem With `VICTORY_PORT_CONSTANTS=1`, `port::open_region` opened the title's graphics memory only through `ID3D12Device13::OpenExistingHeapFromAddress1`. That interface exists only on Windows 11 24H2 and later. On 23H2 the cast fails with `E_NOINTERFACE`, so every region quietly falls back to a host copy: ``` renderer port 1: title memory not in place, a copy as before ... why="refused by the host: ... (0x80004002)" ``` ## Change `inplace::open` now handles `From::Part` itself: 1. It tries `ID3D12Device13::OpenExistingHeapFromAddress1`, as before. 2. If `Device13` is missing (Windows 11 before 24H2) **or refuses**, and the part is its whole allocation, it opens it with `ID3D12Device3::OpenExistingHeapFromAddress`, which every Windows has. Port 1's view of the stretch is always a whole allocation (`MapViewOfFile`), so it qualifies, and `port::open_region` needs no branch of its own. `place_part` (`VICTORY_INPLACE`) and the census get the same fallback whenever their part is a whole allocation. The rules at the top of `inplace.rs` now record that the older call takes a whole committed view of a section. ## Reporter's results (RTX 3080, Windows 11 Pro 23H2 build 22631, driver 621.24, Series X profile) - The port opened all 185 MB of the title's graphics memory, with no errors, crashes or artifacts across 4 sessions. - Copies per frame: 38 → 25 ms. - CPU frame preparation: 71 → 53 ms. - Median fps: 11 → 11.7. ## Test `inplace::tests::warp_a_whole_view_opens_without_device13` runs on WARP. It calls `open_part` with the newer call switched off, which is the path a host without `Device13` takes, whatever the runner has. The test checks: - a whole committed view of a `SEC_RESERVE` section opens; - the card reads the view's bytes and its writes show up in the view; - a part inside the view is refused. **Run on Windows** (`windows-latest`, this PR's head, on my fork while upstream CI waits for approval: [run 46432250492](https://github.com/danielsteman/VIctory-NVIDIA/actions/runs/46432250492)): ``` test inplace::tests::warp_a_whole_view_opens_without_device13 ... ok test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 969 filtered out ``` These are all of `port::tests` and `inplace::tests`, including the WARP probe, whose output shows the runner made a WARP device. `cargo clippy -p victory-gpu --all-targets` passes. Not green, and not from this PR: - The workspace clippy gate (`-D warnings`) fails on `main` at this PR's base `41adb551`. - `cargo test --workspace` stops in `victory-formats`: 3 `bcpack::tests::oracle_parity_*` BC7 tests fail. This PR does not touch that crate. Because cargo stopped there, the rest of `victory-gpu`'s suite did not run in that step. Review notes: the fallback first sat in `port.rs` and ran only when the `Device13` cast failed. A review moved it into `inplace::open`, so it also covers a refusal and every `From::Part` caller. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
trustno1-coder commented 2026-12-01 18:47:30 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:47:30Z.


Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321552478 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3962#issuecomment-7321552478). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:47:30Z. --- Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

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
trustno1-coder/VIctory-NVIDIA!3962
No description provided.