Laptop GPU, Series S under 24 GB, faster copy-back and texture hashing, XG layouts from AnyXboxX #4

Closed
github-bot wants to merge 1 commit from gh-pr/4/head into gh-pr/4/base
Owner

@⁠spy0eye-beep on GitHub · 2026-11-25 18:03 UTC · original
spy0eye-beep:lowspec → main · +7 −7 · 1 files · 23 commits · closed without merging

Five changes for lower-end PCs, each its own commit, on main (7ca2674). Three of them change no output at all; one changes only the default profile; one corrects texture layouts.

The commits

  1. Use the discrete GPU on laptops (12b3f3a). The host device and the shader test host were made on the default adapter, which on a laptop with two GPUs is the integrated one. On an RTX 4060 Laptop + Intel UHD machine flamingo ran on the Intel UHD. Now the first hardware adapter in DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE order that creates a device is used (software adapters never), and logged. VICTORY_TEST_ADAPTER=n runs the tests on the n-th hardware adapter.
  2. Copy-back: changed runs found a word at a time (193711b). Same runs, 10-27 GB/s instead of 2-4 GB/s on masks of scattered writes (word_search_finds_the_byte_runs, mask_runs_speed). Merge and per-run writes unchanged.
  3. Big textures hashed on several threads (d988dca). The same BLAKE3 hash (the_wide_hash_is_the_hash); 0.58 ms instead of 3.7 ms for 16 MB here. Adds blake3's rayon feature.
  4. Series S by default under 24 GB (cf718bb). Without --console, a PC with less than 24 GB of physical memory runs as series-s; 24 GB or more (or unknown) stays series-x. --console is used as given. The choice is printed with its reason.
  5. XG layouts as Microsoft's library gives them (52d79dc), ported from LooperSalty/AnyXboxX (third_party/victory, Looper_Salty's xg: commits, GPL-3.0-or-later): tail mips in parent mode with their position, 64 KiB tilings by subresource. AnyXboxX found 84 texture descriptions that differed from xg_xs.dll. xg_oracle.rs compares with the real DLL only when given its path. This tree's only xg.rs change (not naming the title) is kept.

Considered and left out: freeing idle texture staging buffers (flamingo's pooled staging and late submissions make it unsafe without in-game testing), and the remap lock per 16 MB from JoshuuDev/victory-amd (its own runs found frame time unchanged by the finer locking).

Testing

cargo test --workspace --all-features, Windows 11, i7-13620H, 16 GB:

GPU Result
main as published Intel UHD (the default adapter) 736 passed, 12 failed, one test binary crashed
this branch RTX 4060 Laptop 750 passed, 6 failed, no crash
this branch, VICTORY_TEST_ADAPTER=1 Intel UHD 744 passed, the same 12 failed, no crash

The 6 failures on the RTX 4060 are main's own (barycentric_tests ×3, gs::tests::a_pair_is_a_vertex_shader_and_a_geometry_shader, rect::tests ×2); the 12 on the Intel UHD are those plus intersect_tests ×4 and two valu_tests, as on main.

  • cargo build --release -p victory: OK. rustfmt: no new differences in the touched files.
  • Not run with the title. Commits 2 and 3 are proven equal to the old code by tests; 1, 4 and 5 change what runs and should be tried in game.

AI-assisted (Claude).

🤖 Generated with Claude Code

**@⁠spy0eye-beep** on GitHub · 2026-11-25 18:03 UTC · [original](https://github.com/realblastex/flamingo/pull/4) `spy0eye-beep:lowspec` → `main` · +7 −7 · 1 files · 23 commits · closed without merging Five changes for lower-end PCs, each its own commit, on `main` (`7ca2674`). Three of them change no output at all; one changes only the default profile; one corrects texture layouts. ## The commits 1. **Use the discrete GPU on laptops** (`12b3f3a`). The host device and the shader test host were made on the default adapter, which on a laptop with two GPUs is the integrated one. On an RTX 4060 Laptop + Intel UHD machine flamingo ran on the Intel UHD. Now the first hardware adapter in `DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE` order that creates a device is used (software adapters never), and logged. `VICTORY_TEST_ADAPTER=n` runs the tests on the n-th hardware adapter. 2. **Copy-back: changed runs found a word at a time** (`193711b`). Same runs, 10-27 GB/s instead of 2-4 GB/s on masks of scattered writes (`word_search_finds_the_byte_runs`, `mask_runs_speed`). Merge and per-run writes unchanged. 3. **Big textures hashed on several threads** (`d988dca`). The same BLAKE3 hash (`the_wide_hash_is_the_hash`); 0.58 ms instead of 3.7 ms for 16 MB here. Adds blake3's `rayon` feature. 4. **Series S by default under 24 GB** (`cf718bb`). Without `--console`, a PC with less than 24 GB of physical memory runs as `series-s`; 24 GB or more (or unknown) stays `series-x`. `--console` is used as given. The choice is printed with its reason. 5. **XG layouts as Microsoft's library gives them** (`52d79dc`), ported from LooperSalty/AnyXboxX (`third_party/victory`, Looper_Salty's `xg:` commits, GPL-3.0-or-later): tail mips in parent mode with their position, 64 KiB tilings by subresource. AnyXboxX found 84 texture descriptions that differed from `xg_xs.dll`. `xg_oracle.rs` compares with the real DLL only when given its path. This tree's only `xg.rs` change (not naming the title) is kept. Considered and left out: freeing idle texture staging buffers (flamingo's pooled staging and late submissions make it unsafe without in-game testing), and the remap lock per 16 MB from JoshuuDev/victory-amd (its own runs found frame time unchanged by the finer locking). ## Testing `cargo test --workspace --all-features`, Windows 11, i7-13620H, 16 GB: | | GPU | Result | |---|---|---| | `main` as published | Intel UHD (the default adapter) | 736 passed, 12 failed, one test binary crashed | | this branch | RTX 4060 Laptop | **750 passed, 6 failed, no crash** | | this branch, `VICTORY_TEST_ADAPTER=1` | Intel UHD | 744 passed, the same 12 failed, no crash | The 6 failures on the RTX 4060 are `main`'s own (`barycentric_tests` ×3, `gs::tests::a_pair_is_a_vertex_shader_and_a_geometry_shader`, `rect::tests` ×2); the 12 on the Intel UHD are those plus `intersect_tests` ×4 and two `valu_tests`, as on `main`. - `cargo build --release -p victory`: OK. rustfmt: no new differences in the touched files. - **Not run with the title.** Commits 2 and 3 are proven equal to the old code by tests; 1, 4 and 5 change what runs and should be tried in game. AI-assisted (Claude). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
join_ranges runs on every submission; dedup_by merges the sorted ranges
without building a second list. Same result on 200k random inputs and
the existing test; best of 7: 2 ranges 64 -> 30 ns, 8: 72 -> 42 ns,
32: 135 -> 81 ns, 128: 395 -> 273 ns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:00:27 +00:00
github-bot closed this pull request 2026-11-26 06:00:27 +00:00
Author
Owner

@⁠rafaconvaitis on GitHub · 2026-11-25 18:26 UTC · original

In-title baseline on this PR's base commit 7ca2674, for the copy-back work. Hardware: RTX 4070 (616.64), Ryzen 9 5900X, 32 GB. Series S, D3D12, Relay 1, plain copies, async submit off. The only local source change is a test input hook.

After starting a fresh game and verifying camera input in the first playable room, I left the camera fixed and ran VICTORY_BACK_OWN_VIEW=alt in one process. Each mode had three complete alternating 20 s intervals. I excluded the first second and log windows that cross a switch. Both native views were created successfully and the own-view write counters increased during the sampled intervals.

Metric Own-view off Own-view on
Frame samples 283 278
Effective FPS 7.74 7.89
Frame time P50 / P95 127 / 169.8 ms 124 / 168.5 ms
Host copy-back median 45.1 ms 32.0 ms
Median draw calls/frame 4,213 4,127
Median draw calls skipped for missing pipelines 268 265

This is a measurement of the base commit, before the changed-run scanner and parallel texture hash in this PR. Own-view reduced the measured copy-back cost by roughly 13 ms while end-to-end frame time moved only slightly. Host preparation still measured 61–71 ms/frame in this sample. The fixed camera in this room is a useful repeatable target for testing the PR's copy-back change in-game.

**@⁠rafaconvaitis** on GitHub · 2026-11-25 18:26 UTC · [original](https://github.com/realblastex/flamingo/pull/4#issuecomment-7170903266) In-title baseline on this PR's base commit `7ca2674`, for the copy-back work. Hardware: RTX 4070 (616.64), Ryzen 9 5900X, 32 GB. Series S, D3D12, Relay 1, plain copies, async submit off. The only local source change is a test input hook. After starting a fresh game and verifying camera input in the first playable room, I left the camera fixed and ran `VICTORY_BACK_OWN_VIEW=alt` in one process. Each mode had three complete alternating 20 s intervals. I excluded the first second and log windows that cross a switch. Both native views were created successfully and the own-view write counters increased during the sampled intervals. | Metric | Own-view off | Own-view on | |---|---:|---:| | Frame samples | 283 | 278 | | Effective FPS | 7.74 | 7.89 | | Frame time P50 / P95 | 127 / 169.8 ms | 124 / 168.5 ms | | Host copy-back median | 45.1 ms | 32.0 ms | | Median draw calls/frame | 4,213 | 4,127 | | Median draw calls skipped for missing pipelines | 268 | 265 | This is a measurement of the base commit, before the changed-run scanner and parallel texture hash in this PR. Own-view reduced the measured copy-back cost by roughly 13 ms while end-to-end frame time moved only slightly. Host preparation still measured 61–71 ms/frame in this sample. The fixed camera in this room is a useful repeatable target for testing the PR's copy-back change in-game.
Author
Owner

@⁠realblastex on GitHub · 2026-11-25 20:08 UTC · original

Thank you! The laptop discrete-GPU choice, the threaded texture hashing and the Series S default under 24 GB are in main (11ed9aa), with credit to the commits' author.

The copy-back word search and the XG layouts are on hold for now. Some test runs with them showed large flat polygons and an untextured character, but later runs without them showed the same artifacts: they come and go between runs of the same build, so a single run per setup can't tell what causes them. I'll retest each of the two over several runs before deciding, and keep this PR open until then.

**@⁠realblastex** on GitHub · 2026-11-25 20:08 UTC · [original](https://github.com/realblastex/flamingo/pull/4#issuecomment-7173256407) Thank you! The laptop discrete-GPU choice, the threaded texture hashing and the Series S default under 24 GB are in `main` (11ed9aa), with credit to the commits' author. The copy-back word search and the XG layouts are on hold for now. Some test runs with them showed large flat polygons and an untextured character, but later runs without them showed the same artifacts: they come and go between runs of the same build, so a single run per setup can't tell what causes them. I'll retest each of the two over several runs before deciding, and keep this PR open until then.
Author
Owner

@⁠spy0eye-beep on GitHub · 2026-11-25 21:05 UTC · original

Thanks for merging the three, and @⁠rafaconvaitis for the baseline numbers and the fixed-camera room, which is a good repeatable target.

On the two on hold, in case it helps narrow the intermittent artifacts:

  • Copy-back word search (193711b) can't change what is written: it only changes how the runs of changed bytes are found, and word_search_finds_the_byte_runs checks it against the old byte-by-byte search (random masks of every length 0-40 plus 63/64/65/4095/4096/65536 bytes, five densities). The merge and the per-run writes are untouched. So artifacts that come and go with or without it should be from elsewhere.
  • XG layouts (52d79dc) do change what the title is told about texture layouts (mip tails, 64 KiB tilings), so that one could affect textures, and testing it over several runs is the right call. AnyXboxX reported its 84 differences against xg_xs.dll and, with the library serving layouts, no difference in game, but that was their tree, not this one.

Happy to split either into its own PR if that makes testing easier.

**@⁠spy0eye-beep** on GitHub · 2026-11-25 21:05 UTC · [original](https://github.com/realblastex/flamingo/pull/4#issuecomment-7174608858) Thanks for merging the three, and @⁠rafaconvaitis for the baseline numbers and the fixed-camera room, which is a good repeatable target. On the two on hold, in case it helps narrow the intermittent artifacts: - **Copy-back word search (`193711b`)** can't change what is written: it only changes how the runs of changed bytes are found, and `word_search_finds_the_byte_runs` checks it against the old byte-by-byte search (random masks of every length 0-40 plus 63/64/65/4095/4096/65536 bytes, five densities). The merge and the per-run writes are untouched. So artifacts that come and go with or without it should be from elsewhere. - **XG layouts (`52d79dc`)** do change what the title is told about texture layouts (mip tails, 64 KiB tilings), so that one could affect textures, and testing it over several runs is the right call. AnyXboxX reported its 84 differences against `xg_xs.dll` and, with the library serving layouts, no difference in game, but that was their tree, not this one. Happy to split either into its own PR if that makes testing easier.
Author
Owner

@⁠realblastex on GitHub · 2026-11-25 21:24 UTC · original

Thanks @⁠spy0eye-beep for the explanation, and @⁠rafaconvaitis for the baseline numbers and the fixed-camera room.

You're right about the copy-back word search: since it only changes how the changed runs are found and the test checks it against the byte-by-byte search, it can't cause the artifacts. It's back in and goes out with the next push. The XG layouts stay on hold until I've compared several runs with and without them.

**@⁠realblastex** on GitHub · 2026-11-25 21:24 UTC · [original](https://github.com/realblastex/flamingo/pull/4#issuecomment-7175045961) Thanks @⁠spy0eye-beep for the explanation, and @⁠rafaconvaitis for the baseline numbers and the fixed-camera room. You're right about the copy-back word search: since it only changes how the changed runs are found and the test checks it against the byte-by-byte search, it can't cause the artifacts. It's back in and goes out with the next push. The XG layouts stay on hold until I've compared several runs with and without them.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.