native: the code behind the lit world at about 3.5 fps (draft, reference branch to split) #437

Open
Ketan-Kapse wants to merge 1 commit from upstream-pr/437 into main
Ketan-Kapse commented 2026-11-27 18:21:25 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Ketan-Kapse on 2026-11-27T18:21:25Z.


Refs #380, #79, #356

What this is

A draft, for reference: all of our native macOS host work as one commit on a6a58361 (166 files, about 31,300 added lines). It replaces the earlier version of this draft (b998bb65 base, about 1.8 fps). It is far larger than one change and touches areas other people have claimed, so I do not expect it to be merged as it is. The intent is to make the code readable and testable by others, and to split out whatever is wanted as separate pull requests. Tell me which pieces and I will cut them. Main has moved past a6a58361 since, so expect conflicts.

What it shows on screen (counts and descriptions only)

Apple M4 Pro, 24 GB, macOS 27.0.1, --console series-s. Switches: VICTORY_METAL_RESIDENCY_SETS=1 VICTORY_TEXTURE_DROP_TOP_MIP=1 VICTORY_TRACE_FRAME_TIME=1 (a 270 s run, warm caches).

  • The prologue renders lit, with characters textured: the main character's face with eyes, hair present, and outdoor scenes lit. Remaining faults: grain over the picture (screen-probe indirect light, whose rays miss with the structure builder off, plus a temporal pass that rejects history for much of the frame), a few geometry spikes on characters, and some background characters' faces dark.
  • World: about 3.6 fps (median frame 279 ms, of which the host lock is held about 204 ms). Earlier version of this draft: about 1.8 fps.
  • 0 out-of-memory errors, GPU "In use system memory" peak 13.7 GB.
  • One burst of GPU restarts at the start of the first cutscene (about +110 s); the game carried on. This happens in most untraced runs on this Mac and is still open (see below).

What is new since the earlier version of this draft

  • GPU copies into a texture level the host left out. With VICTORY_TEXTURE_DROP_TOP_MIP=1, a GPU copy into the top level of a texture made without it was dropped silently. The title builds skin and clothing textures on the GPU at run time (decoration bakes, then GPU block compression into BC1/BC3/BC7 top levels), so characters showed black heads or stale clothing. Such a texture is now made again with every level (VICTORY_COPY_FULL, default on; =0 restores the old behaviour, with a warning per skipped copy). This fixed the faces in our runs.
  • Lighting: R9G9B9E5 views aliased over R32_UINT objects; draws of a pipeline made for no render target run in a Metal pass without attachments (local lights, lens flare mask and fog volume proxies now run).
  • Mesh output fitting: meshes over Metal's output limit are declared in a tighter order or drawn in passes; no mesh draw is refused for size.
  • Speed: decode cache, a shorter second lock pass, shadow rounds rescheduled (VICTORY_NO_COMM_WAVES).
  • GPU lifetime rules: heap-retired objects, replaced span buffers and released title pools are kept until command buffers committed before them complete. Shown necessary on this Mac with a standalone test (releasing a texture reached only through resource IDs before its command buffer runs faults the GPU). It did not remove the cutscene GPU restarts.
  • Diagnostics: VICTORY_TRACE_GPU_FAILS=names, VICTORY_TRACE_GATE=1, VICTORY_TRACE_STALE, copy traces under VICTORY_TRACE_TARGETS. Notes in docs/outfit-notes.md and docs/hang-notes.md.
  • Two experiments are included but off by default because they made things worse in game runs: VICTORY_PLACED_SHARE=1 (crashed the title once) and VICTORY_BAKE_SOURCES=1 (froze the world once).

Please check before anything from here is taken

  • resolution.rs and the step-over code compare short byte patterns at fixed image offsets of one title build before changing them, the way crash.rs matches the clwb loops. If that is over the line for the "nothing from the game" rule, say so and I will drop those files.
  • The cutscene GPU restart is open. macOS reports "MMU interrupt"; the first failing command buffer has no compute work and exactly 12 buffer fills (ClearUnorderedAccessView on buffers). Details and what was ruled out are in docs/hang-notes.md.
  • Memory: host texture copies are about 2.4 times the title memory they cover (about 10.7 GB over 4.5 GB in one run). VICTORY_TEXTURE_DROP_TOP_MIP=1 is still needed on 24 GB. Covered-clear (VICTORY_COVERED_CLEAR) still nulls some views the title samples.
  • Guesses about console behaviour are marked in the code and in docs/native-host.md.

How it was tested

  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings on this commit: clean.
  • cargo xtask policy on this commit: 473 files ok. The .dxil fixtures are compiled from the .hlsl files next to them.
  • Ran the game: see above.
  • Release, on Metal, run on the parts before they were squashed into this commit (not re-run on the squashed commit): victory-gpu 565-570 passed, 0 failed, 12 ignored; victory-metal all passed; victory-shader passes except the one known emit::wave32_tests difference noted in the earlier version of this draft.

Checklist

  • No game files, game code, disassembly listings or SDK files are included (see the note on resolution.rs)
  • Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md
  • New diagnostics are behind a VICTORY_* variable and documented
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5531297025 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437). Originally posted by [Ketan-Kapse](https://github.com/Ketan-Kapse) on 2026-11-27T18:21:25Z. --- Refs #380, #79, #356 ## What this is A **draft, for reference**: all of our native macOS host work as one commit on a6a58361 (166 files, about 31,300 added lines). It replaces the earlier version of this draft (b998bb65 base, about 1.8 fps). It is far larger than one change and touches areas other people have claimed, so I do not expect it to be merged as it is. The intent is to make the code readable and testable by others, and to split out whatever is wanted as separate pull requests. Tell me which pieces and I will cut them. Main has moved past a6a58361 since, so expect conflicts. ## What it shows on screen (counts and descriptions only) Apple M4 Pro, 24 GB, macOS 27.0.1, `--console series-s`. Switches: `VICTORY_METAL_RESIDENCY_SETS=1 VICTORY_TEXTURE_DROP_TOP_MIP=1 VICTORY_TRACE_FRAME_TIME=1` (a 270 s run, warm caches). - The prologue renders lit, with characters textured: the main character's face with eyes, hair present, and outdoor scenes lit. Remaining faults: grain over the picture (screen-probe indirect light, whose rays miss with the structure builder off, plus a temporal pass that rejects history for much of the frame), a few geometry spikes on characters, and some background characters' faces dark. - World: about **3.6 fps** (median frame 279 ms, of which the host lock is held about 204 ms). Earlier version of this draft: about 1.8 fps. - 0 out-of-memory errors, GPU "In use system memory" peak 13.7 GB. - One burst of GPU restarts at the start of the first cutscene (about +110 s); the game carried on. This happens in most untraced runs on this Mac and is still open (see below). ## What is new since the earlier version of this draft - **GPU copies into a texture level the host left out.** With `VICTORY_TEXTURE_DROP_TOP_MIP=1`, a GPU copy into the top level of a texture made without it was dropped silently. The title builds skin and clothing textures on the GPU at run time (decoration bakes, then GPU block compression into BC1/BC3/BC7 top levels), so characters showed black heads or stale clothing. Such a texture is now made again with every level (`VICTORY_COPY_FULL`, default on; `=0` restores the old behaviour, with a warning per skipped copy). This fixed the faces in our runs. - **Lighting:** R9G9B9E5 views aliased over R32_UINT objects; draws of a pipeline made for no render target run in a Metal pass without attachments (local lights, lens flare mask and fog volume proxies now run). - **Mesh output fitting:** meshes over Metal's output limit are declared in a tighter order or drawn in passes; no mesh draw is refused for size. - **Speed:** decode cache, a shorter second lock pass, shadow rounds rescheduled (`VICTORY_NO_COMM_WAVES`). - **GPU lifetime rules:** heap-retired objects, replaced span buffers and released title pools are kept until command buffers committed before them complete. Shown necessary on this Mac with a standalone test (releasing a texture reached only through resource IDs before its command buffer runs faults the GPU). It did not remove the cutscene GPU restarts. - **Diagnostics:** `VICTORY_TRACE_GPU_FAILS=names`, `VICTORY_TRACE_GATE=1`, `VICTORY_TRACE_STALE`, copy traces under `VICTORY_TRACE_TARGETS`. Notes in `docs/outfit-notes.md` and `docs/hang-notes.md`. - Two experiments are included but **off by default** because they made things worse in game runs: `VICTORY_PLACED_SHARE=1` (crashed the title once) and `VICTORY_BAKE_SOURCES=1` (froze the world once). ## Please check before anything from here is taken - **`resolution.rs` and the step-over code compare short byte patterns at fixed image offsets of one title build** before changing them, the way `crash.rs` matches the clwb loops. If that is over the line for the "nothing from the game" rule, say so and I will drop those files. - **The cutscene GPU restart is open.** macOS reports "MMU interrupt"; the first failing command buffer has no compute work and exactly 12 buffer fills (`ClearUnorderedAccessView` on buffers). Details and what was ruled out are in `docs/hang-notes.md`. - **Memory:** host texture copies are about 2.4 times the title memory they cover (about 10.7 GB over 4.5 GB in one run). `VICTORY_TEXTURE_DROP_TOP_MIP=1` is still needed on 24 GB. Covered-clear (`VICTORY_COVERED_CLEAR`) still nulls some views the title samples. - Guesses about console behaviour are marked in the code and in `docs/native-host.md`. ## How it was tested - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` on this commit: clean. - [x] `cargo xtask policy` on this commit: 473 files ok. The `.dxil` fixtures are compiled from the `.hlsl` files next to them. - [x] Ran the game: see above. - Release, on Metal, run on the parts before they were squashed into this commit (not re-run on the squashed commit): victory-gpu 565-570 passed, 0 failed, 12 ignored; victory-metal all passed; victory-shader passes except the one known `emit::wave32_tests` difference noted in the earlier version of this draft. ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included (see the note on `resolution.rs`) - [x] Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md - [x] New diagnostics are behind a `VICTORY_*` variable and documented
Ketan-Kapse commented 2026-11-27 18:33:37 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Ketan-Kapse on 2026-11-27T18:33:37Z.


CI status after 556974a7: the Windows check job now fails on one test only, the one named in the description (emit::wave32_tests::a_branch_on_a_first_lane_read_is_not_uniform_across_the_halves: expects (0, false), this branch's console-flow lowering gives (6, true); 548 other shader tests pass). The first run's failure (native::descriptors::tests::default_texture_srv_replaces_the_texture_in_the_backend_slot) was ours and is fixed: native::safe_read had no Windows arm, so mirror decoded a zero record there.

I have left the shader test as it is on purpose. It pins main's behaviour for a branch on a first-lane read, and the console-flow lowering changes that behaviour, so whether the lowering or the test should give way is your call, not something to settle by editing the test in a reference branch.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7225615415 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437#issuecomment-7225615415). Originally posted by [Ketan-Kapse](https://github.com/Ketan-Kapse) on 2026-11-27T18:33:37Z. --- CI status after 556974a7: the Windows `check` job now fails on one test only, the one named in the description (`emit::wave32_tests::a_branch_on_a_first_lane_read_is_not_uniform_across_the_halves`: expects `(0, false)`, this branch's console-flow lowering gives `(6, true)`; 548 other shader tests pass). The first run's failure (`native::descriptors::tests::default_texture_srv_replaces_the_texture_in_the_backend_slot`) was ours and is fixed: `native::safe_read` had no Windows arm, so `mirror` decoded a zero record there. I have left the shader test as it is on purpose. It pins main's behaviour for a branch on a first-lane read, and the console-flow lowering changes that behaviour, so whether the lowering or the test should give way is your call, not something to settle by editing the test in a reference branch.
derz92 commented 2026-11-27 20:59:34 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-27T20:59:34Z.


Ran this branch on another Mac: M5 Max, 36 GB, macOS 26.5, Series S. Tree: #437 (head at b998bb65) plus #358, with only local mute and window switches on top. Same switches as the description: VICTORY_CONSOLE_PIPELINES=0 VICTORY_METAL_RESIDENCY_SETS=1 VICTORY_TEXTURE_DROP_TOP_MIP=1 VICTORY_OUTPUT=1280x720 VICTORY_UPSCALER=6 VICTORY_STEP_OVER=pool VICTORY_PIPELINE_TIMEOUT_S=15.

It renders lit here too. On a cold cache (337 s) the prologue cutscene reached the 1280x720 output target, correctly lit. At about frame 1850 it showed the silhouette at the mesh window against the sunlit yard and watchtower. Results: 0 failed command buffers, 0 out-of-memory errors, GPU "In use system memory" peak about 14 GB, back to about 1 GB at exit, 44 refused shader sets (23 of them the divergent cross-lane cascade shaders, as you listed).

A stall on a warm cache, two runs out of two. With the cache warm, presents stopped at frame about 1490 and about 1570 (just after the cutscene starts), at 260% CPU, with no GPU errors and nothing left queued. A thread dump at the stall had the title's main thread in WaitForSingleObject and two title threads busy in title code. The cold run, which was slower because of compiles, went straight past that point.

  • With VICTORY_TEXTURE_BACK=1 (which #449 makes the default), the warm run went past it: the cutscene advanced (yard fence, then the window again) and the run kept presenting to its cap (frame 1920 at 363 s, 0 GPU errors, 274 textures copied back).
  • The cost: copy-back adds pink and green speckle and coloured radial streaks over the scene. That may be the same purple and green noise you describe.

So on this Mac the title seems to wait on something the GPU writes, and copy-back unblocks it.

Two things for splitting this up:

  • wave32_tests::a_branch_on_a_first_lane_read_is_not_uniform_across_the_halves fails on this branch. It passes on main and on #438 alone.
  • Merged with #438 and run with VICTORY_LOCKSTEP_WAVES=1, the translator panics during prewarm within 5 s (bitcode.rs:1064 "forward reference outside a phi" and :990 "use of a void value"). My conflict resolution was trivial, keeping both sides, at options() and around find_sections(), so it may be mine. But the two don't combine as they stand.

The same window shot on the cold run without copy-back was clean, so the speckle comes with copy-back. Next, I'm narrowing which copied-back textures the stall needs and which ones bring the noise, starting with copy-back limited to small textures. I'll post what that finds.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7228031219 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437#issuecomment-7228031219). Originally posted by [derz92](https://github.com/derz92) on 2026-11-27T20:59:34Z. --- Ran this branch on another Mac: M5 Max, 36 GB, macOS 26.5, Series S. Tree: #437 (head at b998bb65) plus #358, with only local mute and window switches on top. Same switches as the description: `VICTORY_CONSOLE_PIPELINES=0 VICTORY_METAL_RESIDENCY_SETS=1 VICTORY_TEXTURE_DROP_TOP_MIP=1 VICTORY_OUTPUT=1280x720 VICTORY_UPSCALER=6 VICTORY_STEP_OVER=pool VICTORY_PIPELINE_TIMEOUT_S=15`. **It renders lit here too.** On a cold cache (337 s) the prologue cutscene reached the 1280x720 output target, correctly lit. At about frame 1850 it showed the silhouette at the mesh window against the sunlit yard and watchtower. Results: 0 failed command buffers, 0 out-of-memory errors, GPU "In use system memory" peak about 14 GB, back to about 1 GB at exit, 44 refused shader sets (23 of them the divergent cross-lane cascade shaders, as you listed). **A stall on a warm cache, two runs out of two.** With the cache warm, presents stopped at frame about 1490 and about 1570 (just after the cutscene starts), at 260% CPU, with no GPU errors and nothing left queued. A thread dump at the stall had the title's main thread in `WaitForSingleObject` and two title threads busy in title code. The cold run, which was slower because of compiles, went straight past that point. - With `VICTORY_TEXTURE_BACK=1` (which #449 makes the default), the warm run **went past it**: the cutscene advanced (yard fence, then the window again) and the run kept presenting to its cap (frame 1920 at 363 s, 0 GPU errors, 274 textures copied back). - The cost: copy-back adds pink and green speckle and coloured radial streaks over the scene. That may be the same purple and green noise you describe. So on this Mac the title seems to wait on something the GPU writes, and copy-back unblocks it. **Two things for splitting this up:** - `wave32_tests::a_branch_on_a_first_lane_read_is_not_uniform_across_the_halves` fails on this branch. It passes on main and on #438 alone. - Merged with #438 and run with `VICTORY_LOCKSTEP_WAVES=1`, the translator panics during prewarm within 5 s (`bitcode.rs:1064 "forward reference outside a phi"` and `:990 "use of a void value"`). My conflict resolution was trivial, keeping both sides, at `options()` and around `find_sections()`, so it may be mine. But the two don't combine as they stand. The same window shot on the cold run without copy-back was clean, so the speckle comes with copy-back. Next, I'm narrowing which copied-back textures the stall needs and which ones bring the noise, starting with copy-back limited to small textures. I'll post what that finds.
derz92 commented 2026-11-27 22:35:08 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-27T22:35:08Z.


Two small speed-ups for this branch, with a test. They're in one commit on top of your head: https://github.com/derz92/Native-Victory-macOS/commits/perf/437-mirror (ec78c8d1). Cherry-pick it if you want them.

  1. remirror_tables mirrors the record it just read. It used to call mirror(handle) for each changed entry, which searches the heaps again and reads the record again through record_at (mach_vm_read_overwrite, one system call each, about 80k a world frame here). It now calls a new mirror_record(heap, index, record, pool_gen, res_gen) with the record from the span read. The generations are captured before the span read, so at worst a stamp is older than the bytes, which means a needless remirror and never a stale entry marked current. New test: an_entry_mirrored_from_a_stale_record_is_rebuilt_at_the_next_check.
  2. twin_plane checks the view format before texture_info_of. For every 2D view at mip 0, it read the title's resource description (about 25 µs) before finding that a colour view can't show a depth plane. It now returns early unless the format is one the plane match takes (R32F/R32U/R16Unorm/R16U/R8U) or a depth format. The depth-format case keeps the lazy register_depth exactly as before. On this Mac that lookup alone was about 100 ms of a world frame.

Measured on an M5 Max, Series S, warm cache, your switches, median of the last 120 world frames. This is one run per step, so read it as indicative:

frame mirror time
this branch 524 ms 224 ms
+ 1 487 ms 192 ms
+ 1 + 2 407 ms 105 ms

The image is unchanged, by screen captures of the same cutscene shots. Checks on this commit: victory-gpu --lib 484 passed (twice), Windows clippy clean, policy ok. On one of three parallel runs, texture_tests::releasing_a_gpu_written_texture_releases_its_placed_alias failed and then passed alone 3 of 3 times, so it looks flaky rather than caused by this.

Also a correction from me: copy-back turned out to have nothing to do with the warm-cache stall I mentioned above. Details on #456.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7229450880 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437#issuecomment-7229450880). Originally posted by [derz92](https://github.com/derz92) on 2026-11-27T22:35:08Z. --- Two small speed-ups for this branch, with a test. They're in one commit on top of your head: https://github.com/derz92/Native-Victory-macOS/commits/perf/437-mirror (`ec78c8d1`). Cherry-pick it if you want them. 1. **`remirror_tables` mirrors the record it just read.** It used to call `mirror(handle)` for each changed entry, which searches the heaps again and reads the record again through `record_at` (`mach_vm_read_overwrite`, one system call each, about 80k a world frame here). It now calls a new `mirror_record(heap, index, record, pool_gen, res_gen)` with the record from the span read. The generations are captured before the span read, so at worst a stamp is older than the bytes, which means a needless remirror and never a stale entry marked current. New test: `an_entry_mirrored_from_a_stale_record_is_rebuilt_at_the_next_check`. 2. **`twin_plane` checks the view format before `texture_info_of`.** For every 2D view at mip 0, it read the title's resource description (about 25 µs) before finding that a colour view can't show a depth plane. It now returns early unless the format is one the plane match takes (R32F/R32U/R16Unorm/R16U/R8U) or a depth format. The depth-format case keeps the lazy `register_depth` exactly as before. On this Mac that lookup alone was about 100 ms of a world frame. Measured on an M5 Max, Series S, warm cache, your switches, median of the last 120 world frames. This is one run per step, so read it as indicative: | | frame | mirror time | |---|---|---| | this branch | 524 ms | 224 ms | | + 1 | 487 ms | 192 ms | | + 1 + 2 | 407 ms | 105 ms | The image is unchanged, by screen captures of the same cutscene shots. Checks on this commit: `victory-gpu --lib` 484 passed (twice), Windows clippy clean, policy ok. On one of three parallel runs, `texture_tests::releasing_a_gpu_written_texture_releases_its_placed_alias` failed and then passed alone 3 of 3 times, so it looks flaky rather than caused by this. Also a correction from me: copy-back turned out to have nothing to do with the warm-cache stall I mentioned above. Details on #456.
derz92 commented 2026-11-27 22:51:12 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-27T22:51:12Z.


On the missing hair, a lead: VICTORY_MESH_OVER_LIMIT=1 brings it back on this Mac.

Your branch refuses four mesh programs on the 32 KiB output guard here (declared outputs of 33,792, 36,864 and 38,400 bytes). With the guard bypassed, on the same binary and switches, all four compiled through the converter and Metal on macOS 26.5 with no error, and the 300 s run had 0 failed command buffers. Two visible differences:

  • Hair draws. A cutscene close-up has a character's hair, and the dark spikes that stood out of the player's head and neck in the window shot are gone. The hair and face still look speckled, which may be the screen-probe noise.
  • More of the yard outside the window draws. You can see the buildings, the watchtower and figures in the yard, where before there was mostly a bright orange glow.

So the outputs fit on this Mac despite the declared size. Maybe the declared size overstates what Metal needs, or Apple's limit is higher on M5. Do you know where the 32,768 comes from? If it's Metal's documented mesh payload limit, it might be worth checking the actual pipeline creation result instead of the declared size, and refusing only if that fails.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7229670299 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437#issuecomment-7229670299). Originally posted by [derz92](https://github.com/derz92) on 2026-11-27T22:51:12Z. --- On the missing hair, a lead: `VICTORY_MESH_OVER_LIMIT=1` brings it back on this Mac. Your branch refuses four mesh programs on the 32 KiB output guard here (declared outputs of 33,792, 36,864 and 38,400 bytes). With the guard bypassed, on the same binary and switches, all four compiled through the converter and Metal on macOS 26.5 with no error, and the 300 s run had **0 failed command buffers**. Two visible differences: - **Hair draws.** A cutscene close-up has a character's hair, and the dark spikes that stood out of the player's head and neck in the window shot are gone. The hair and face still look speckled, which may be the screen-probe noise. - **More of the yard outside the window draws.** You can see the buildings, the watchtower and figures in the yard, where before there was mostly a bright orange glow. So the outputs fit on this Mac despite the declared size. Maybe the declared size overstates what Metal needs, or Apple's limit is higher on M5. Do you know where the 32,768 comes from? If it's Metal's documented mesh payload limit, it might be worth checking the actual pipeline creation result instead of the declared size, and refusing only if that fails.
Ketan-Kapse commented 2026-11-27 22:55:23 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Ketan-Kapse on 2026-11-27T22:55:23Z.


@derz92 thank you, all three comments were useful. Answers and what has changed here since.

#438 with this branch: same result here, so it is not your merge. I merged #438 the same way (both sides kept at options() and around find_sections()) and ran the translator over the 38 kept containers that this branch refuses for "a cross-lane operation between host waves in divergent code", with VICTORY_LOCKSTEP_WAVES=1: 3 translate, 19 are refused (11 "an s_barrier the console waves of a lockstep group may reach unevenly", 8 "an exchange between host waves in an earlier block"), 16 panic (12 "use of a void value", 4 "forward reference outside a phi"). The panics also happen with VICTORY_NO_CONSOLE_FLOW=1.

Your speed commit. The second half (the view-format check before texture_info_of in twin_plane) is ported by hand on my side and passes victory-gpu --lib on Metal; your commit no longer applies as it is because that part of host.rs has been reworked since. The first half is covered by that rework: the table scan now reads the records once and mirrors from what it read. I will measure the twin_plane part in a game run and report.

The 32 KiB mesh guard. Good find. The number is the guard this branch took over; I do not have a source for it that I trust, and I had not tested what Metal really accepts. I am testing that now on an M4 Pro (synthetic mesh pipelines at several declared sizes: does creation fail, does it render correctly), and separately trimming the outputs a paired pixel shader never reads. The aim is zero mesh programs refused for size. One reason for care: an older build on the Wine route that built such pipelines anyway hung the GPU queue here. Your result also changes how I read our screenshots: the spikes on the character's head are probably skipped hair and head meshes, not a skinning fault as I had guessed.

Since the description above (same Mac, same scene, 8-minute runs):

  • Speed: 1.8 to about 3.0 fps. Three passes on descriptor mirroring: a decode cache keyed by record content for views the title writes again at fresh ring-heap entries, clean marks so an unchanged bound table costs one compare, and dense per-entry state instead of hash maps. Re-mirroring went from about 250 ms to about 50 ms a world frame; the frame is now about 340 ms with the host lock held about 225 ms and the GPU busy about 120 to 140 ms.
  • Shadows: 31 of those 38 cross-lane programs now translate by another route (bounded if-conversion of acyclic regions, group-synchronous loop scheduling, and LDS phases with elected atomics executed once per console wave). All have GPU value tests on Metal. With everything on they cost about 50 ms of GPU time a frame; the first versions cost far more (up to 4 s a frame) until barriers were hoisted out of invariant loops and batched. Seven stay refused.
  • A regression I have not solved yet: since merging main b998bb65 the dormitory interior is black except for sun patches (before the merge it was dim but visible), and some wall meshes are not drawn. Being bisected now. VICTORY_COVERED_CLEAR still frees nothing.

None of this is pushed to this branch yet. I will update the draft once the interior lighting and the mesh guard are sorted, and then split out whatever is wanted.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7229727987 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437#issuecomment-7229727987). Originally posted by [Ketan-Kapse](https://github.com/Ketan-Kapse) on 2026-11-27T22:55:23Z. --- @derz92 thank you, all three comments were useful. Answers and what has changed here since. **#438 with this branch: same result here, so it is not your merge.** I merged #438 the same way (both sides kept at `options()` and around `find_sections()`) and ran the translator over the 38 kept containers that this branch refuses for "a cross-lane operation between host waves in divergent code", with `VICTORY_LOCKSTEP_WAVES=1`: 3 translate, 19 are refused (11 "an s_barrier the console waves of a lockstep group may reach unevenly", 8 "an exchange between host waves in an earlier block"), 16 panic (12 "use of a void value", 4 "forward reference outside a phi"). The panics also happen with `VICTORY_NO_CONSOLE_FLOW=1`. **Your speed commit.** The second half (the view-format check before `texture_info_of` in `twin_plane`) is ported by hand on my side and passes `victory-gpu --lib` on Metal; your commit no longer applies as it is because that part of `host.rs` has been reworked since. The first half is covered by that rework: the table scan now reads the records once and mirrors from what it read. I will measure the `twin_plane` part in a game run and report. **The 32 KiB mesh guard.** Good find. The number is the guard this branch took over; I do not have a source for it that I trust, and I had not tested what Metal really accepts. I am testing that now on an M4 Pro (synthetic mesh pipelines at several declared sizes: does creation fail, does it render correctly), and separately trimming the outputs a paired pixel shader never reads. The aim is zero mesh programs refused for size. One reason for care: an older build on the Wine route that built such pipelines anyway hung the GPU queue here. Your result also changes how I read our screenshots: the spikes on the character's head are probably skipped hair and head meshes, not a skinning fault as I had guessed. **Since the description above (same Mac, same scene, 8-minute runs):** - Speed: 1.8 to about 3.0 fps. Three passes on descriptor mirroring: a decode cache keyed by record content for views the title writes again at fresh ring-heap entries, clean marks so an unchanged bound table costs one compare, and dense per-entry state instead of hash maps. Re-mirroring went from about 250 ms to about 50 ms a world frame; the frame is now about 340 ms with the host lock held about 225 ms and the GPU busy about 120 to 140 ms. - Shadows: 31 of those 38 cross-lane programs now translate by another route (bounded if-conversion of acyclic regions, group-synchronous loop scheduling, and LDS phases with elected atomics executed once per console wave). All have GPU value tests on Metal. With everything on they cost about 50 ms of GPU time a frame; the first versions cost far more (up to 4 s a frame) until barriers were hoisted out of invariant loops and batched. Seven stay refused. - A regression I have not solved yet: since merging main b998bb65 the dormitory interior is black except for sun patches (before the merge it was dim but visible), and some wall meshes are not drawn. Being bisected now. `VICTORY_COVERED_CLEAR` still frees nothing. None of this is pushed to this branch yet. I will update the draft once the interior lighting and the mesh guard are sorted, and then split out whatever is wanted.
derz92 commented 2026-11-27 23:06:22 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-27T23:06:22Z.


Thanks, that all helps. A request: could you push the three mirroring passes (the decode cache by record content, the clean marks, and dense per-entry state) as soon as they pass your tests, even before the interior lighting and the mesh guard are sorted, perhaps on a separate branch? They don't touch lighting. I can then A/B them here on the M5 Max (one binary, settled-world medians, three runs each way) and report numbers alongside your M4 Pro ones. On this Mac the frame is about 360 to 400 ms with hold_submit about 190 ms, so mirroring is still the biggest CPU item here too.

One more data point for your lock work: in our counters, about 70% of the title's device descriptor writes (14k to 24k of 19k to 30k a frame) land in heaps that aren't shader-visible, and each takes the title lock through glue::mirror. Skipping the lock for them can't simply drop realize, though: the first attempt here pushed texture creation into submission. I'm measuring a version that keeps that part.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7229875227 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437#issuecomment-7229875227). Originally posted by [derz92](https://github.com/derz92) on 2026-11-27T23:06:22Z. --- Thanks, that all helps. A request: could you push the three mirroring passes (the decode cache by record content, the clean marks, and dense per-entry state) as soon as they pass your tests, even before the interior lighting and the mesh guard are sorted, perhaps on a separate branch? They don't touch lighting. I can then A/B them here on the M5 Max (one binary, settled-world medians, three runs each way) and report numbers alongside your M4 Pro ones. On this Mac the frame is about 360 to 400 ms with `hold_submit` about 190 ms, so mirroring is still the biggest CPU item here too. One more data point for your lock work: in our counters, about 70% of the title's device descriptor writes (14k to 24k of 19k to 30k a frame) land in heaps that aren't shader-visible, and each takes the title lock through `glue::mirror`. Skipping the lock for them can't simply drop `realize`, though: the first attempt here pushed texture creation into submission. I'm measuring a version that keeps that part.
LakshanSivakumar commented 2026-11-28 01:03:00 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-28T01:03:00Z.


@Ketan-Kapse this PR has become the base for my own testing, thank you. I put fixes on top of it and pushed the result as the branch lit-world/base-3 (#518, the cross-page loads, texture fixes, the page table for described pipelines, the image null-view test), so you can see what I am running.

One ask: you wrote that your local tree translates 31 of 38 cross-lane programs by if-conversion. Could you push that work, even unfinished, as a draft PR or a branch? On this base the prologue interior is still black for me, and the trace says the light is lost at cross-lane computes (#526, #527). Your if-conversion is the fix I would otherwise have to write from scratch, and I would rather build on yours and credit you.

Also, if you still have the switches and the commit where the dormitory was lit before you merged b998bb65, please post them. I could not find a lit interior on any pushed tree.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7231382406 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437#issuecomment-7231382406). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-28T01:03:00Z. --- @Ketan-Kapse this PR has become the base for my own testing, thank you. I put fixes on top of it and pushed the result as the branch `lit-world/base-3` (#518, the cross-page loads, texture fixes, the page table for described pipelines, the image null-view test), so you can see what I am running. One ask: you wrote that your local tree translates 31 of 38 cross-lane programs by if-conversion. Could you push that work, even unfinished, as a draft PR or a branch? On this base the prologue interior is still black for me, and the trace says the light is lost at cross-lane computes (#526, #527). Your if-conversion is the fix I would otherwise have to write from scratch, and I would rather build on yours and credit you. Also, if you still have the switches and the commit where the dormitory was lit before you merged b998bb65, please post them. I could not find a lit interior on any pushed tree.
derz92 commented 2026-11-28 01:35:10 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-28T01:35:10Z.


A correction to my mesh-guard comment: please disregard it. In that run the oversized programs were still refused by the second check (mesh_refused_over_limit=10753). I'd searched for the wrong message and concluded they had compiled. So the hair and yard differences weren't from them, and your skinning guess may stand. A later run on lit-world/base-3 with every check bypassed shows Metal refusing them itself at pipeline creation ("Total mesh size (36864) exceeds the maximum mesh size allowed (32768)"), so the 32 KiB limit is real on macOS 26.5 / M5 Max, and your output-trimming approach is the way. Details on #528. Sorry for the noise.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7231771843 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437#issuecomment-7231771843). Originally posted by [derz92](https://github.com/derz92) on 2026-11-28T01:35:10Z. --- A correction to my mesh-guard comment: please disregard it. In that run the oversized programs were **still refused** by the second check (`mesh_refused_over_limit=10753`). I'd searched for the wrong message and concluded they had compiled. So the hair and yard differences weren't from them, and your skinning guess may stand. A later run on `lit-world/base-3` with every check bypassed shows **Metal refusing them itself** at pipeline creation ("Total mesh size (36864) exceeds the maximum mesh size allowed (32768)"), so the 32 KiB limit is real on macOS 26.5 / M5 Max, and your output-trimming approach is the way. Details on #528. Sorry for the noise.
derz92 commented 2026-11-28 02:14:43 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-28T02:14:43Z.


@LakshanSivakumar, since lit-world/base-3 is your test base: here are four speed changes on top of it, about +48% world frame rate here. They're on a branch: https://github.com/derz92/Native-Victory-macOS/commits/perf/base-3 (5 commits on 9a0d811d).

A/B on one Mac, same switches, settled world (median of the last 120 s, frames with more than 500 draws; M5 Max, Series S, VICTORY_METAL_RESIDENCY_SETS=1, #437's switches):

plain base-3 with the branch
frame 722, 721 ms 491, 487, 482 ms
fps 1.39 2.05
mirror 269 ms 160 ms
hold_sync 60 ms 14 ms
GPU (cb) 100 ms 61 ms

(One plain run froze at the #456 point, so there are two plain runs.)

What's in it, with what each one moves:

  1. twin_plane checks the view format before texture_info_of (Ketan already ported this). A colour view can't show a depth plane, and reading the title's resource description cost about 25 µs × 4,000 image mirrors a frame. Depth-format views still register lazily. Moves mirror.
  2. VICTORY_PROBE_PER_FRAME=1 (opt-in): the hot and blank texture probes share one budget per presented frame instead of one per submission (about 17 a frame). Trade-off: a texture write can be noticed up to a frame later. Moves hold_sync.
  3. A fast content hash for texture change detection instead of BLAKE3. Under Rosetta, BLAKE3's x86 SIMD paths are translated: 2.0 GB/s, against 19.2 GB/s for a 4-lane multiply-rotate hash (native/content_hash.rs, non-cryptographic, independent of how the input is split, tested). Shader and placement keys stay BLAKE3. One catch: with hashing ~10× cheaper, the uncapped scanner covers far more memory and finds more of the title's CPU texture writes, so texture sync read 560–700 MiB/s instead of 200–290 and uploaded more, and on its own it was slower. It pays only together with VICTORY_TEXTURE_SCAN_MBPS (300 in these runs). That's your existing switch, with its documented stale-texture trade-off.
  4. VICTORY_CONCURRENT_COMPUTE=1 (opt-in, experiment): a concurrent compute encoder with a memory barrier wherever the pipeline changes and around indirect dispatches. With VICTORY_PASS_TIMING (#484), the costliest world passes were chains of hundreds of tiny dispatches of one pipeline (972 in one pass, about 22 µs each), serialised by the default encoder. GPU time per frame went from 77 to 59 ms in a single-run comparison, with no visible glitches or GPU errors over about 10 runs. It's a guess: back-to-back dispatches of one pipeline are taken not to depend on each other, and the title's barriers aren't followed yet. It needs a better rule before it could be a default.

All on by default in the A/B run except where marked opt-in. Checks on the branch: victory-gpu --lib 507 passed, Windows clippy clean, policy ok. Take any part that's useful; I can split them into separate PRs against whichever base you prefer.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7232231461 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437#issuecomment-7232231461). Originally posted by [derz92](https://github.com/derz92) on 2026-11-28T02:14:43Z. --- @LakshanSivakumar, since `lit-world/base-3` is your test base: here are four speed changes on top of it, about **+48% world frame rate here**. They're on a branch: https://github.com/derz92/Native-Victory-macOS/commits/perf/base-3 (5 commits on `9a0d811d`). **A/B on one Mac, same switches, settled world** (median of the last 120 s, frames with more than 500 draws; M5 Max, Series S, `VICTORY_METAL_RESIDENCY_SETS=1`, #437's switches): | | plain base-3 | with the branch | |---|---|---| | frame | 722, 721 ms | 491, 487, 482 ms | | fps | 1.39 | 2.05 | | mirror | 269 ms | 160 ms | | hold_sync | 60 ms | 14 ms | | GPU (cb) | 100 ms | 61 ms | (One plain run froze at the #456 point, so there are two plain runs.) **What's in it, with what each one moves:** 1. **`twin_plane` checks the view format before `texture_info_of`** (Ketan already ported this). A colour view can't show a depth plane, and reading the title's resource description cost about 25 µs × 4,000 image mirrors a frame. Depth-format views still register lazily. Moves `mirror`. 2. **`VICTORY_PROBE_PER_FRAME=1`** (opt-in): the hot and blank texture probes share one budget per presented frame instead of one per submission (about 17 a frame). Trade-off: a texture write can be noticed up to a frame later. Moves `hold_sync`. 3. **A fast content hash for texture change detection** instead of BLAKE3. Under Rosetta, BLAKE3's x86 SIMD paths are translated: 2.0 GB/s, against 19.2 GB/s for a 4-lane multiply-rotate hash (`native/content_hash.rs`, non-cryptographic, independent of how the input is split, tested). Shader and placement keys stay BLAKE3. **One catch:** with hashing ~10× cheaper, the uncapped scanner covers far more memory and finds more of the title's CPU texture writes, so texture sync read 560–700 MiB/s instead of 200–290 and uploaded more, and on its own it was *slower*. It pays only together with `VICTORY_TEXTURE_SCAN_MBPS` (300 in these runs). That's your existing switch, with its documented stale-texture trade-off. 4. **`VICTORY_CONCURRENT_COMPUTE=1`** (opt-in, experiment): a concurrent compute encoder with a memory barrier wherever the pipeline changes and around indirect dispatches. With `VICTORY_PASS_TIMING` (#484), the costliest world passes were chains of hundreds of tiny dispatches of one pipeline (972 in one pass, about 22 µs each), serialised by the default encoder. GPU time per frame went from 77 to 59 ms in a single-run comparison, with no visible glitches or GPU errors over about 10 runs. **It's a guess:** back-to-back dispatches of one pipeline are taken not to depend on each other, and the title's barriers aren't followed yet. It needs a better rule before it could be a default. All on by default in the A/B run except where marked opt-in. Checks on the branch: `victory-gpu --lib` 507 passed, Windows clippy clean, policy ok. Take any part that's useful; I can split them into separate PRs against whichever base you prefer.
derz92 commented 2026-11-28 05:20:36 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-28T05:20:36Z.


Two more on perf/base-3 (same link as above), each A/B'd on one Mac with everything else identical. Settled-world medians, M5 Max, Series S:

  1. remirror_tables mirrors the record its span read gave (mirror_record): no record_at system call or heap search per changed entry. Ketan said his rework covers this, but lit-world/base-3 didn't have it. 413 / 415 / 420 ms vs 452 / 453 ms (−8.5%). It comes with an_entry_mirrored_from_a_stale_record_is_rebuilt_at_the_next_check.
  2. PoolTable::signature caches each range's value until the table's generation changes. On base-3, mirror_record's buffer path calls alias_signature per mirror, which walks every mapping the view spans and SipHashes them. Step timers put that at about 51 ms of a 130 ms mirror budget. The same large views come up thousands of times between two table changes. 388 / 391 ms vs 407 / 414 / 415 ms (−5.5%), with mirror 88 vs 106–110 ms. Test: memory::tests::a_signature_follows_every_change_of_the_table (a remap or unmap never gets the cached value).

With all six on this branch, base-3 here goes from about 722 ms (1.39 fps) to about 390 ms (2.55 fps). Checks: victory-gpu --lib 509 passed, Windows clippy clean, policy ok.

Also, two experiments that didn't help here, so nobody repeats them: taking the per-entry heap maps off SipHash (an integer hasher on mirrored, pending_mirror and spanned), and a memo that skips a bound table whose bytes are unchanged (95% of checks hit it, but the time is in the changed ring entries). Neither moved the frame time.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7234609461 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437#issuecomment-7234609461). Originally posted by [derz92](https://github.com/derz92) on 2026-11-28T05:20:36Z. --- Two more on `perf/base-3` (same link as above), each A/B'd on one Mac with everything else identical. Settled-world medians, M5 Max, Series S: 5. **`remirror_tables` mirrors the record its span read gave** (`mirror_record`): no `record_at` system call or heap search per changed entry. Ketan said his rework covers this, but `lit-world/base-3` didn't have it. **413 / 415 / 420 ms vs 452 / 453 ms (−8.5%).** It comes with `an_entry_mirrored_from_a_stale_record_is_rebuilt_at_the_next_check`. 6. **`PoolTable::signature` caches each range's value until the table's generation changes.** On base-3, `mirror_record`'s buffer path calls `alias_signature` per mirror, which walks every mapping the view spans and SipHashes them. Step timers put that at about 51 ms of a 130 ms mirror budget. The same large views come up thousands of times between two table changes. **388 / 391 ms vs 407 / 414 / 415 ms (−5.5%)**, with `mirror` 88 vs 106–110 ms. Test: `memory::tests::a_signature_follows_every_change_of_the_table` (a remap or unmap never gets the cached value). With all six on this branch, base-3 here goes from about **722 ms (1.39 fps) to about 390 ms (2.55 fps)**. Checks: `victory-gpu --lib` 509 passed, Windows clippy clean, policy ok. Also, two experiments that **didn't** help here, so nobody repeats them: taking the per-entry heap maps off SipHash (an integer hasher on `mirrored`, `pending_mirror` and `spanned`), and a memo that skips a bound table whose bytes are unchanged (95% of checks hit it, but the time is in the changed ring entries). Neither moved the frame time.
derz92 commented 2026-11-28 08:35:04 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-28T08:35:04Z.


@Ketan-Kapse, your new head (7badeaa7) on an M5 Max, macOS 26.5, Series S, with your switches (VICTORY_METAL_RESIDENCY_SETS=1 VICTORY_TEXTURE_DROP_TOP_MIP=1), warm cache: settled world median 297–334 ms (about 3.0 fps), 0 GPU errors, a clean picture. Very nice jump from the previous head.

Five of my earlier changes still add on top of it. They're on a branch on your head: https://github.com/derz92/Native-Victory-macOS/commits/perf/ketan-35 (8 commits). A/B on one Mac, alternating, 300 s world caps:

runs settled median
7badeaa7 as is 3 297 / 333 / 334 ms
+ the branch (with VICTORY_PROBE_PER_FRAME=1 VICTORY_CONCURRENT_COMPUTE=1 VICTORY_TEXTURE_SCAN_MBPS=300) 3 262 / 268 / 271 ms (about 3.7 fps)

Most of the gain is GPU time per frame, 106–123 → 73–75 ms, from the concurrent compute encoder (barriers only at pipeline changes and around indirect dispatches; still a guess about dependencies, see the docs line). The rest comes from the content hash plus scan cap (texture-sync hashing was BLAKE3 under Rosetta, 2 GB/s against 19 GB/s), per-frame probe budgets, and caching PoolTable::signature and resolve per table generation (with tests that a change never returns a cached value).

Checks on the branch: victory-gpu --lib 578 passed, Windows clippy clean, xtask policy ok. I left #565 (VICTORY_LOOKUP_EXIT) out of the branch because its docs push native-host.md over the policy size limit. It does rescue the #456 freeze on your head too, in my runs. Take whatever is useful.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7236677303 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/437#issuecomment-7236677303). Originally posted by [derz92](https://github.com/derz92) on 2026-11-28T08:35:04Z. --- @Ketan-Kapse, your new head (`7badeaa7`) on an M5 Max, macOS 26.5, Series S, with your switches (`VICTORY_METAL_RESIDENCY_SETS=1 VICTORY_TEXTURE_DROP_TOP_MIP=1`), warm cache: **settled world median 297–334 ms (about 3.0 fps)**, 0 GPU errors, a clean picture. Very nice jump from the previous head. Five of my earlier changes still add on top of it. They're on a branch on your head: https://github.com/derz92/Native-Victory-macOS/commits/perf/ketan-35 (8 commits). A/B on one Mac, alternating, 300 s world caps: | | runs | settled median | |---|---|---| | `7badeaa7` as is | 3 | 297 / 333 / 334 ms | | + the branch (with `VICTORY_PROBE_PER_FRAME=1 VICTORY_CONCURRENT_COMPUTE=1 VICTORY_TEXTURE_SCAN_MBPS=300`) | 3 | **262 / 268 / 271 ms** (about 3.7 fps) | Most of the gain is GPU time per frame, 106–123 → 73–75 ms, from the concurrent compute encoder (barriers only at pipeline changes and around indirect dispatches; still a guess about dependencies, see the docs line). The rest comes from the content hash plus scan cap (texture-sync hashing was BLAKE3 under Rosetta, 2 GB/s against 19 GB/s), per-frame probe budgets, and caching `PoolTable::signature` and `resolve` per table generation (with tests that a change never returns a cached value). Checks on the branch: `victory-gpu --lib` 578 passed, Windows clippy clean, `xtask policy` ok. I left #565 (`VICTORY_LOOKUP_EXIT`) out of the branch because its docs push `native-host.md` over the policy size limit. It does rescue the #456 freeze on your head too, in my runs. Take whatever is useful.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/437:upstream-pr/437'
git switch 'upstream-pr/437'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/437'
git switch 'upstream-pr/437'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/437'
git switch 'upstream-pr/437'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/437'
git switch 'main'
git merge --squash 'upstream-pr/437'
git switch 'main'
git merge --ff-only 'upstream-pr/437'
git switch 'main'
git merge 'upstream-pr/437'
git push origin 'main'
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!437
No description provided.