WIP: perf(os): virtual cores taken and released without vc_lock while no thread waits for one, each owner slot on its own cache line (HOS_VCORE_FAST, off) #1972

Draft
siantm wants to merge 6 commits from siantm/Longshot:perf/vcore-fast into main
Contributor

Summary

Every take and every release of a virtual core goes through one lock, vc_lock (host/hos_thread.c), also when no
thread waits for a core: a guest thread takes its core after every block and gives it up at the next one, tens of
thousands of times a second, on all of the game's threads at once.

This adds an experiment, off by default, in two steps (one commit each; the second was #1973, folded in here as the
review asked):

  1. HOS_VCORE_FAST=1: a take (vc_take_fast) and a release (vc_release, vc_free_slot) take no lock while nobody
    is queued for a core. What holds without the lock (the comment above vc_fast gives the whole argument):
    • a slot goes from free to a thread only by a compare-and-swap, and back to free only by its holder;
    • a waiter counts itself in vc_nq and then looks at the cores again (vc_settle); a release frees the slot and
      then reads vc_nq: one of the two sees the other, so no waiter sleeps beside a free core;
    • a fast take reads vc_nq again after it, and gives the core to a waiter that came in between;
    • #327's rules: a fast take chooses from one read of the mask and, under mask 0, of the core the guest cached
      (vc_aff), as vc_free_for does. After its take it reads both again and writes the guest's TLS core cell in the
      same tls_slot_lock section (vc_fast_check); if either changed it gives the core up and chooses again. A mask
      change stores the mask and then reads vc_held under the lock (vc_note_mask_change); the fast take stores
      vc_held and then reads the mask, a fence in each, so one of the two sees the other;
    • a release no longer waits for the lock, so DestroyThread passes vc_lock once (vc_exited) before a thread's
      record is freed.
  2. Each core's owner slot on a cache line of its own (vc_owner[8] becomes eight 64-byte-aligned slots, .t): with
    step 1 alone every take and release on one core takes the line of the eight slots from the holders of the others.

Round 1 of review (#1972 62911/62912, #1973 62913/62914, BeanBot 62391/62404) changed:

  • the fast take no longer keeps a core chosen under an affinity that changed before its take was published, nor writes
    that core into the guest's cell over the cached one (the review's remask back to mask 0);
  • the mask, ideal core, vc_last, the hold and kick times and vc_kick are read and written as atomics where another
    thread reads them; hos_thread_core reads vc_held once; vc_sync_tls_as reads the mask under tls_slot_lock;
    with the switch on the cached core is read under that lock, its slot validated there;
  • a fast take clears its kick and kick time and stores its hold time before its slot names it;
  • the takes without the lock have their own counter, taken by the 5 s line with one exchange, and a destroyed thread
    adds its last ones;
  • the wait loop's three scans for a holder to ask test the waiter's affinity before they read a slot, as main's
    equal-priority scan did;
  • a grant that names no thread shows "given at a release" in the Tracy zone, not an empty name. A waiter that finds a
    core freed without the lock before the release that freed it takes the lock gets it as "found free", without the
    releasing thread in its long-wait line (said in the comment above vc_fast).

With HOS_VCORE_FAST unset, what changes against main: a test of the switch at each take, release and slot store
(the stores themselves are main's: relaxed atomics, the same instructions as main's plain stores on x86-64, and
vc_nq's release store; no fence in vc_note_mask_change; the take count is main's vc_st.takes++ under the
lock); the owner slots take 512 bytes instead of 64; the wait loop's scans read fewer slots; vc_sync_tls_as reads the
mask inside its lock section; the 5 s line does one atomic exchange of the (then zero) fast-take counter. A mask-0
thread's cached core is read as on main (without tls_slot_lock) while the switch is unset.

The switch is read once and said once in the log; its row is in gpu/vk/switches.def (kind attempt). Leaving
HOS_VCORE_FAST unset turns the fast path off.

From d1e33769 (the host-sync integration) and cafb4100 (its host/hos_thread.c half) on exp/x86-asm-sync, where it
was on by default and never measured; rewritten over #327 (a104182b).

tests/test_vcore_escape.py's fixture declares hos_fps_timing twice on main (#1860, still open, fixes the same
line; whichever lands second rebases) and tests/test_vcore_mask0.py's fixture has no env_on_or: both are fixed
here. tests/test_slow_frames.py looked for vc_grant(c, t) in vc_release, which main already moved into
vc_release_locked: it now checks both release paths.

Read first: the comment above vc_fast, vc_take_fast, vc_fast_check, vc_free_slot, vc_settle and
vc_note_mask_change in host/hos_thread.c.

Testing

Tested: Windows 11, i7-9700, RTX 4060 (NVIDIA 610.88), llvm-mingw clang 23.1.5; game-free checks and a
micro-benchmark only. This change has not run in the game on this PC yet (Still to test). Each check ran in a hidden
console of its own, through the PC's job queue (job fb3-1972-1), on this branch on main @ f1f2dc5b (head c9d646dc):

  • python -I -B tests/test_vcore_mask0.py --cxx clang++: exit 0, "the defaults: ok", "HOS_VCORE_FAST=1: ok". At the
    test commit 570f35da (before the fix) it fails: "the defaults: FAIL: a take's write of the cell after a same-core
    remask's: the cell names the core (one-core mask)" (the unset run fails first, so its HOS_VCORE_FAST=1 run does not
    start there). With vc_fast_check's comparison taken out of this head's source (--source, a mutated copy), the
    HOS_VCORE_FAST=1 run fails on both remask cases, the review's remask back to mask 0 among them.
  • python -I -B tests/test_vcore_escape.py --cxx clang++: exit 0, "the defaults: ok", "the defaults,
    HOS_VCORE_STARVE_US=0: ok", "HOS_VCORE_FAST=1: ok", "HOS_VCORE_FAST=1, HOS_VCORE_STARVE_US=0: ok". On mutated copies
    of this head's source its HOS_VCORE_FAST=1 run fails each time: the fast take's compare-and-swap made a store ("two
    takers for core 0: the first to take it holds it"), its second look at the queue taken out ("a waiter that queued as
    a take without vc_lock took its core is given that core at once"), vc_exited without its pass of vc_lock, and a
    destroyed thread's last takes not added ("the 5 s line counts every take, a destroyed thread's last ones too").
  • python -I -B tests/test_slow_frames.py: exit 0, "slow frames: ok".
  • python -I -B tests/test_switch_table.py --cxx clang++: exit 0, "ok: 735 switches (diag 295, tune 109, kill 129,
    attempt 81, hw 67, player 54), 144 removed, 743 names read".
  • python -I -B tests/run_all.py --strict --changed origin/main: exit 1, "44 passed, 11 failed, 4 skipped".
    test_vcore_escape, test_vcore_mask0, test_slow_frames and test_switch_table pass. 8 of the 11 failures fail on
    main @ f1f2dc5b too (run by name in the same job, "6 passed, 11 failed"): test_crash_dialog, test_crash_record,
    test_dev_ab, test_dev_packs, test_frame_overlap, test_linux_pressure, test_profiling_mode, test_walk_key.
    The other three (test_present_queue_default, test_target_reuse_memory, test_vk_occlusion_queries) compiled
    nothing in that run nor in the run on main (no Vulkan headers on the job's path: "not found: vulkan_headers
    (--strict)"). Rerun with the headers (job fb3-vk-1, RX_CPM set) at the head c9d646dc and on main @ f1f2dc5b, each
    fails at both with the same first error: test_present_queue_default "srccut: '{TAB_DEBUG, "Present queue",
    &opts.present_queue, ...' is not in gpu/vk/vk_menu.cpp"; test_target_reuse_memory 2 of its 8 tests
    ("'vmaGetAllocationInfo2' unexpectedly found" in the VMA source, and its fixture's "use of undeclared identifier
    'destroy_image_later'"); test_vk_occlusion_queries "the ring fixture did not compile" ("no member named 'policy'").
    None fails on this branch alone.

Still to test:

  • Windows 11, this PC (i7-9700, RTX 4060 (NVIDIA 610.88)): main against this PR with HOS_VCORE_FAST unset and with
    HOS_VCORE_FAST=1, warmed and interleaved, on the same scripted route through Castle Town's market, a busy outdoor
    route, and a route with queued waits for a core; average fps, 1 % lows, median and p99 frame times, and the "vcores:"
    lines' waits, escapes and kicks, expecting the log line "vcores: takes and releases without vc_lock while nobody
    waits (HOS_VCORE_FAST)" only with it set, no "ran without a core" line, no crash (by hand)
  • Linux: build the host and run python3 -I -B tests/test_vcore_escape.py and tests/test_vcore_mask0.py, expecting
    both to pass with the switch off and on (by hand)
  • PCs with 6 or fewer logical processors, and the Steam Deck: the same three-way comparison in a busy area, expecting
    frame times within the runs' spread or better with the switch set and no "ran without a core" line (the Test Farm:
    Castle Town's market for two minutes on PCs with 6 or fewer logical processors and on the Steam Deck, main against
    this PR with HOS_VCORE_FAST unset and set, comparing frame times and looking for "ran without a core" in the log)

Measurements

Verdict: micro-benchmarks only; nothing has been measured in play. HOS_VCORE_FAST ships off (kind attempt).
In the micro-benchmark, step 1 alone made a take and a release slower than the locked path (a loss); both steps
together made them faster. At this head, with the switch set, a take and a release cost 54 to 78 % less than on main;
with it unset, no difference from main was measured (the ranges overlap; the medians are 1 to 10 % higher) (below).

All micro-benchmarks: Windows 11, i7-9700 (8 cores, no SMT), llvm-mingw clang++ 23.1.5, -O2; host/hos_thread.c's
vcore block compiled with Windows' own SRW locks, 2, 4 and 6 threads each taking and giving up its own core
(hos_vcore_back, hos_vcore_away) with 8 virtual cores, so nobody waits and the wait loop never runs; 15
interleaved rounds of 400 ms, the median and the rounds' range, ns per take+release per thread; one timing job of the
PC's queue each.

Before this round's fixes (step 1 at 15e55f96 and both steps at 026a1abc, on main @ 51f5f9da; locked: step 1 with the
switch unset):

ns per take+release Before, HOS_VCORE_FAST unset: step 1 @ 15e55f96 After, HOS_VCORE_FAST=1: step 1 alone @ 15e55f96 After, HOS_VCORE_FAST=1: steps 1+2 @ 026a1abc
2 threads 170.1 (161.9-200.6) 218.5 (199.8-236.4), +28 % (a loss) 56.0 (53.6-66.4), -67 %
4 threads 366.5 (345.9-391.0) 436.3 (407.6-464.3), +19 % (a loss) 59.0 (56.2-68.1), -84 %
6 threads 587.0 (561.4-621.5) 633.7 (603.6-739.2), +8 % (a loss) 67.2 (61.6-85.6), -89 %

Step 1 alone loses because the eight owner slots share one cache line, which every take and release on every core then
writes; it is not to be turned on without step 2, and here goes in only with it.

This head (c9d646dc) against main @ f1f2dc5b, the same micro-benchmark (one timing job of the PC's queue,
fb3-1972-1-bench):

ns per take+release Before: main @ f1f2dc5b After, HOS_VCORE_FAST unset: this PR @ c9d646dc After, HOS_VCORE_FAST=1: this PR @ c9d646dc
2 threads 115.5 (111.9-126.6) 117.0 (113.4-124.2), +1.3 % 52.8 (51.3-56.8), -54.3 %
4 threads 246.6 (238.7-259.3) 258.3 (253.3-269.4), +4.7 % 55.6 (54.0-59.3), -77.5 %
6 threads 377.6 (359.7-413.3) 415.4 (384.5-447.1), +10.0 % 81.7 (72.6-91.2), -78.4 %

With the switch unset the ranges overlap main's at all three thread counts: no difference measured, though every
median is higher (1 to 10 %). With it set the ranges do not overlap main's.

The micro-benchmark measures a take and a release with nobody waiting, not a frame: what it saves or costs in play is
still to test (above), as is the wait loop's change, which it never reaches.

Risks

Off, a take and a release test a switch read once, their stores are main's, and the owner slots are 64 bytes apart:
Summary lists what else differs from main. On, the scheduler's core hand-over runs without its lock while nobody
waits: a mistake would show as a lost grant (a thread waiting for a core beside a free one, until its 1 ms look finds
it, or an escape after 2 s), two threads on one core, or a stale guest core number. Turn it off by leaving
HOS_VCORE_FAST unset; a revert is enough. Players notice nothing: the switch is not set for them.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary Every take and every release of a virtual core goes through one lock, `vc_lock` (`host/hos_thread.c`), also when no thread waits for a core: a guest thread takes its core after every block and gives it up at the next one, tens of thousands of times a second, on all of the game's threads at once. This adds an experiment, off by default, in two steps (one commit each; the second was #1973, folded in here as the review asked): 1. `HOS_VCORE_FAST=1`: a take (`vc_take_fast`) and a release (`vc_release`, `vc_free_slot`) take no lock while nobody is queued for a core. What holds without the lock (the comment above `vc_fast` gives the whole argument): - a slot goes from free to a thread only by a compare-and-swap, and back to free only by its holder; - a waiter counts itself in `vc_nq` and then looks at the cores again (`vc_settle`); a release frees the slot and then reads `vc_nq`: one of the two sees the other, so no waiter sleeps beside a free core; - a fast take reads `vc_nq` again after it, and gives the core to a waiter that came in between; - #327's rules: a fast take chooses from one read of the mask and, under mask 0, of the core the guest cached (`vc_aff`), as `vc_free_for` does. After its take it reads both again and writes the guest's TLS core cell in the same `tls_slot_lock` section (`vc_fast_check`); if either changed it gives the core up and chooses again. A mask change stores the mask and then reads `vc_held` under the lock (`vc_note_mask_change`); the fast take stores `vc_held` and then reads the mask, a fence in each, so one of the two sees the other; - a release no longer waits for the lock, so `DestroyThread` passes `vc_lock` once (`vc_exited`) before a thread's record is freed. 2. Each core's owner slot on a cache line of its own (`vc_owner[8]` becomes eight 64-byte-aligned slots, `.t`): with step 1 alone every take and release on one core takes the line of the eight slots from the holders of the others. Round 1 of review (#1972 62911/62912, #1973 62913/62914, BeanBot 62391/62404) changed: - the fast take no longer keeps a core chosen under an affinity that changed before its take was published, nor writes that core into the guest's cell over the cached one (the review's remask back to mask 0); - the mask, ideal core, `vc_last`, the hold and kick times and `vc_kick` are read and written as atomics where another thread reads them; `hos_thread_core` reads `vc_held` once; `vc_sync_tls_as` reads the mask under `tls_slot_lock`; with the switch on the cached core is read under that lock, its slot validated there; - a fast take clears its kick and kick time and stores its hold time before its slot names it; - the takes without the lock have their own counter, taken by the 5 s line with one exchange, and a destroyed thread adds its last ones; - the wait loop's three scans for a holder to ask test the waiter's affinity before they read a slot, as `main`'s equal-priority scan did; - a grant that names no thread shows "given at a release" in the Tracy zone, not an empty name. A waiter that finds a core freed without the lock before the release that freed it takes the lock gets it as "found free", without the releasing thread in its long-wait line (said in the comment above `vc_fast`). With `HOS_VCORE_FAST` unset, what changes against `main`: a test of the switch at each take, release and slot store (the stores themselves are `main`'s: relaxed atomics, the same instructions as `main`'s plain stores on x86-64, and `vc_nq`'s release store; no fence in `vc_note_mask_change`; the take count is `main`'s `vc_st.takes++` under the lock); the owner slots take 512 bytes instead of 64; the wait loop's scans read fewer slots; `vc_sync_tls_as` reads the mask inside its lock section; the 5 s line does one atomic exchange of the (then zero) fast-take counter. A mask-0 thread's cached core is read as on `main` (without `tls_slot_lock`) while the switch is unset. The switch is read once and said once in the log; its row is in `gpu/vk/switches.def` (kind `attempt`). Leaving `HOS_VCORE_FAST` unset turns the fast path off. From d1e33769 (the host-sync integration) and cafb4100 (its `host/hos_thread.c` half) on `exp/x86-asm-sync`, where it was on by default and never measured; rewritten over #327 (a104182b). `tests/test_vcore_escape.py`'s fixture declares `hos_fps_timing` twice on `main` (#1860, still open, fixes the same line; whichever lands second rebases) and `tests/test_vcore_mask0.py`'s fixture has no `env_on_or`: both are fixed here. `tests/test_slow_frames.py` looked for `vc_grant(c, t)` in `vc_release`, which `main` already moved into `vc_release_locked`: it now checks both release paths. Read first: the comment above `vc_fast`, `vc_take_fast`, `vc_fast_check`, `vc_free_slot`, `vc_settle` and `vc_note_mask_change` in `host/hos_thread.c`. ## Testing **Tested:** Windows 11, i7-9700, RTX 4060 (NVIDIA 610.88), llvm-mingw clang 23.1.5; game-free checks and a micro-benchmark only. This change has not run in the game on this PC yet (Still to test). Each check ran in a hidden console of its own, through the PC's job queue (job fb3-1972-1), on this branch on `main` @ f1f2dc5b (head c9d646dc): - `python -I -B tests/test_vcore_mask0.py --cxx clang++`: exit 0, "the defaults: ok", "HOS_VCORE_FAST=1: ok". At the test commit 570f35da (before the fix) it fails: "the defaults: FAIL: a take's write of the cell after a same-core remask's: the cell names the core (one-core mask)" (the unset run fails first, so its HOS_VCORE_FAST=1 run does not start there). With `vc_fast_check`'s comparison taken out of this head's source (`--source`, a mutated copy), the HOS_VCORE_FAST=1 run fails on both remask cases, the review's remask back to mask 0 among them. - `python -I -B tests/test_vcore_escape.py --cxx clang++`: exit 0, "the defaults: ok", "the defaults, HOS_VCORE_STARVE_US=0: ok", "HOS_VCORE_FAST=1: ok", "HOS_VCORE_FAST=1, HOS_VCORE_STARVE_US=0: ok". On mutated copies of this head's source its HOS_VCORE_FAST=1 run fails each time: the fast take's compare-and-swap made a store ("two takers for core 0: the first to take it holds it"), its second look at the queue taken out ("a waiter that queued as a take without vc_lock took its core is given that core at once"), `vc_exited` without its pass of `vc_lock`, and a destroyed thread's last takes not added ("the 5 s line counts every take, a destroyed thread's last ones too"). - `python -I -B tests/test_slow_frames.py`: exit 0, "slow frames: ok". - `python -I -B tests/test_switch_table.py --cxx clang++`: exit 0, "ok: 735 switches (diag 295, tune 109, kill 129, attempt 81, hw 67, player 54), 144 removed, 743 names read". - `python -I -B tests/run_all.py --strict --changed origin/main`: exit 1, "44 passed, 11 failed, 4 skipped". `test_vcore_escape`, `test_vcore_mask0`, `test_slow_frames` and `test_switch_table` pass. 8 of the 11 failures fail on `main` @ f1f2dc5b too (run by name in the same job, "6 passed, 11 failed"): `test_crash_dialog`, `test_crash_record`, `test_dev_ab`, `test_dev_packs`, `test_frame_overlap`, `test_linux_pressure`, `test_profiling_mode`, `test_walk_key`. The other three (`test_present_queue_default`, `test_target_reuse_memory`, `test_vk_occlusion_queries`) compiled nothing in that run nor in the run on `main` (no Vulkan headers on the job's path: "not found: vulkan_headers (--strict)"). Rerun with the headers (job fb3-vk-1, `RX_CPM` set) at the head c9d646dc and on `main` @ f1f2dc5b, each fails at both with the same first error: `test_present_queue_default` "srccut: '{TAB_DEBUG, "Present queue", &opts.present_queue, ...' is not in gpu/vk/vk_menu.cpp"; `test_target_reuse_memory` 2 of its 8 tests ("'vmaGetAllocationInfo2' unexpectedly found" in the VMA source, and its fixture's "use of undeclared identifier 'destroy_image_later'"); `test_vk_occlusion_queries` "the ring fixture did not compile" ("no member named 'policy'"). None fails on this branch alone. **Still to test:** - Windows 11, this PC (i7-9700, RTX 4060 (NVIDIA 610.88)): `main` against this PR with `HOS_VCORE_FAST` unset and with `HOS_VCORE_FAST=1`, warmed and interleaved, on the same scripted route through Castle Town's market, a busy outdoor route, and a route with queued waits for a core; average fps, 1 % lows, median and p99 frame times, and the "vcores:" lines' waits, escapes and kicks, expecting the log line "vcores: takes and releases without vc_lock while nobody waits (HOS_VCORE_FAST)" only with it set, no "ran without a core" line, no crash (by hand) - Linux: build the host and run `python3 -I -B tests/test_vcore_escape.py` and `tests/test_vcore_mask0.py`, expecting both to pass with the switch off and on (by hand) - PCs with 6 or fewer logical processors, and the Steam Deck: the same three-way comparison in a busy area, expecting frame times within the runs' spread or better with the switch set and no "ran without a core" line (the Test Farm: Castle Town's market for two minutes on PCs with 6 or fewer logical processors and on the Steam Deck, `main` against this PR with HOS_VCORE_FAST unset and set, comparing frame times and looking for "ran without a core" in the log) ## Measurements **Verdict:** micro-benchmarks only; nothing has been measured in play. `HOS_VCORE_FAST` ships off (kind `attempt`). In the micro-benchmark, step 1 alone made a take and a release slower than the locked path (a loss); both steps together made them faster. At this head, with the switch set, a take and a release cost 54 to 78 % less than on `main`; with it unset, no difference from `main` was measured (the ranges overlap; the medians are 1 to 10 % higher) (below). All micro-benchmarks: Windows 11, i7-9700 (8 cores, no SMT), llvm-mingw clang++ 23.1.5, `-O2`; `host/hos_thread.c`'s vcore block compiled with Windows' own SRW locks, 2, 4 and 6 threads each taking and giving up its own core (`hos_vcore_back`, `hos_vcore_away`) with 8 virtual cores, so nobody waits and the wait loop never runs; 15 interleaved rounds of 400 ms, the median and the rounds' range, ns per take+release per thread; one timing job of the PC's queue each. Before this round's fixes (step 1 at 15e55f96 and both steps at 026a1abc, on `main` @ 51f5f9da; locked: step 1 with the switch unset): | ns per take+release | Before, HOS_VCORE_FAST unset: step 1 @ 15e55f96 | After, HOS_VCORE_FAST=1: step 1 alone @ 15e55f96 | After, HOS_VCORE_FAST=1: steps 1+2 @ 026a1abc | |---|---|---|---| | 2 threads | 170.1 (161.9-200.6) | 218.5 (199.8-236.4), +28 % (a loss) | 56.0 (53.6-66.4), -67 % | | 4 threads | 366.5 (345.9-391.0) | 436.3 (407.6-464.3), +19 % (a loss) | 59.0 (56.2-68.1), -84 % | | 6 threads | 587.0 (561.4-621.5) | 633.7 (603.6-739.2), +8 % (a loss) | 67.2 (61.6-85.6), -89 % | Step 1 alone loses because the eight owner slots share one cache line, which every take and release on every core then writes; it is not to be turned on without step 2, and here goes in only with it. This head (c9d646dc) against `main` @ f1f2dc5b, the same micro-benchmark (one timing job of the PC's queue, `fb3-1972-1-bench`): | ns per take+release | Before: `main` @ f1f2dc5b | After, HOS_VCORE_FAST unset: this PR @ c9d646dc | After, HOS_VCORE_FAST=1: this PR @ c9d646dc | |---|---|---|---| | 2 threads | 115.5 (111.9-126.6) | 117.0 (113.4-124.2), +1.3 % | 52.8 (51.3-56.8), -54.3 % | | 4 threads | 246.6 (238.7-259.3) | 258.3 (253.3-269.4), +4.7 % | 55.6 (54.0-59.3), -77.5 % | | 6 threads | 377.6 (359.7-413.3) | 415.4 (384.5-447.1), +10.0 % | 81.7 (72.6-91.2), -78.4 % | With the switch unset the ranges overlap `main`'s at all three thread counts: no difference measured, though every median is higher (1 to 10 %). With it set the ranges do not overlap `main`'s. The micro-benchmark measures a take and a release with nobody waiting, not a frame: what it saves or costs in play is still to test (above), as is the wait loop's change, which it never reaches. ## Risks Off, a take and a release test a switch read once, their stores are `main`'s, and the owner slots are 64 bytes apart: Summary lists what else differs from `main`. On, the scheduler's core hand-over runs without its lock while nobody waits: a mistake would show as a lost grant (a thread waiting for a core beside a free one, until its 1 ms look finds it, or an escape after 2 s), two threads on one core, or a stale guest core number. Turn it off by leaving `HOS_VCORE_FAST` unset; a revert is enough. Players notice nothing: the switch is not set for them. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [ ] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [ ] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
perf(os): virtual cores taken and released without vc_lock while no thread waits for one (HOS_VCORE_FAST, off)
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 14s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
e6acd10c72
HOS_VCORE_FAST=1 is an experiment, off by default: nothing measures it yet.
Off, every path is #327's, under vc_lock. On, a take (vc_take_fast) and a
release (vc_release) take no lock while nobody is queued for a core; a
waiter queues first and then looks at the cores again (vc_settle), a release
frees the slot and then reads vc_nq, so one of the two sees the other. A
slot is taken only by a compare-and-swap (vc_take_if_free under the lock).

Over #327's mask rules:
- the fast take picks the core vc_free_for picks (a mask-0 thread's cached
  core first, vc_pref_core) and writes the guest's TLS core cell after a
  successful take (vc_sync_tls);
- a mask change stores the mask and then reads vc_held under vc_lock, the
  fast take stores vc_held and then reads the mask, with a fence in each:
  a change the take missed makes the take ask itself to move (its kick),
  which the next checkpoint does; a same-core change writes the cell only
  while the thread still holds that core (vc_sync_tls_as).
A release no longer waits for the lock, so DestroyThread passes vc_lock once
(vc_exited) before a thread's record is freed. Takes without the lock are
added to the 5 s line 64 at a time.

tests/test_vcore_escape.py runs off and on: no vc_lock for a take and a
release with nobody queued (off: one each), a release, a better waiter's
kick and a yield handing the core to the right waiter, vc_lock never taken
twice, each slot naming its holder; the starvation cases both ways.
tests/test_vcore_mask0.py runs off and on, with a take through
hos_vcore_back (the cached core, the cell) and, on, a mask change that lands
between the take's choice and its take.

From exp/x86-asm-sync d1e33769 (the host-sync integration; vc_take_fast,
vc_settle, vc_exited), rewritten over #327 (a104182b): the branch's take
ignored vc_pref_core, wrote no TLS cell and had no ordering against
vc_note_mask_change.

Assisted-by: Claude Code
BeanBot left a comment

Recommendation: Request changes. The fast path races with affinity changes, TLS updates and scheduler diagnostics. The experiment also changes the default hot path, whose cost was never measured against main.

Adds an opt-in virtual-core scheduler path that skips vc_lock on uncontended takes and releases. It preserves the common handoffs in the reported fixtures, but adds a second ownership protocol, more synchronization on the default path and new races when enabled.

@fix will do (14)

  1. L1 host/hos_thread.c:2117: The mask used for validation is separate from the mask used to choose a core. (more on the line)
  2. L2 host/hos_thread.c:168: hos_thread_core reads vc_held twice with plain loads while the target can clear it atomically. A remote GetThreadCoreMask or pin_by_core can race a release. If the test sees a held core and the subtraction sees zero, it returns -1 and pin_by_core can shift by a negative count. Take one atomic snapshot here and audit the other cross-thread readers of vc_held.
  3. L3 host/hos_thread.c:1932: The fast taker samples the mask before acquiring tls_slot_lock. (more on the line)
  4. L4 host/hos_thread.c:1883: The fast mask-0 chooser reads the cached cell outside the lock used by vc_sync_tls_as. A same-core remask can pass its held check, then the target can release and start another take before the remask writes the cell. The preference read and pending write can overlap. vc_pref_core also reads vc_last while the fast taker can update it. Synchronize cache reads with writes and slot reuse, and use a synchronized snapshot for vc_last.
  5. L5 host/hos_thread.c:2129: The owner CAS exposes t before the fast taker initializes vc_held_at and vc_kick_at. (more on the line)
  6. L6 host/hos_thread.c:2039: vc_stats_locked reads takes normally and clears it with memset while fast takers can atomically add to it. A 64-take flush during the log call races the reset and can disappear. Keep takes outside the bulk reset and use an atomic exchange to capture the interval count. Flush each thread's final partial batch on exit so short-lived threads are counted.
  7. L7 (minor) host/hos_thread.c:2299: A fast release can free a slot and then lose the lock to a timed-out waiter. (more on the line)
  8. L8 tests/test_slow_frames.py:127: The source check still requires vc_grant(c, t) inside vc_release. That call exists at the merge base and is gone at HEAD. Even if the author's base run failed elsewhere, this assertion now fails on its own. Update it to cover attribution in both release paths, preferably by checking the resulting diagnostic behavior.
  9. L9 tests/test_vcore_escape.py:312: The release hook runs after the waiter has queued and entered sleep. (more on the line)
  10. L10 tests/test_vcore_mask0.py:270: The remask hook writes the field directly and calls vc_note_mask_change on the taker's host thread. (more on the line)
  11. L11 (minor) tests/test_vcore_mask0.py:289: Both revised fixtures default to clang++ when called directly. A Linux machine with only g++ fails the documented standalone command even with CXX=g++ set. Keep --cxx as the explicit override and use CXX and the runner's compiler fallback for direct invocation in both files.
  12. L12 (its part an edit can do) host/hos_thread.c:2123: Put owner slots on separate cache lines in the same patch and measure that revision against main.
  13. L13 (its part an edit can do) host/hos_thread.c:2166: Keep the existing synchronization and counter increments on the locked path where possible. Measure the remaining differences against the merge base.
  14. L14 (minor): The PR describes an unchanged default path and predicts no player-visible change. The unset path changes synchronization and logging, and the current benchmark cannot establish the impact. Describe those changes in Risks and label the measurement as a comparison of two modes of the same patched build.

For the author (2) (a run, a measurement or a decision)

  • L12 host/hos_thread.c:2123: The enabled standalone path loses in its own target workload. (more on the line)
  • L13 (minor) host/hos_thread.c:2166: The benchmark calls the unset branch the main path, but both columns include the PR's sequentially consistent owner and held stores, atomic take counter and switch checks. (more on the line)

Checks: Still running: CI / Conventional Commit title (pull_request), CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request), CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request), CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request), CI / Workflow lint (actionlint) (pull_request), CI / Website build and checks (pull_request), Guide screenshots / Guide images and local UI source review (pull_request), Third-party parts / As their notes say (pull_request), Third-party parts / The same as upstream (pull_request), Website / Website on Cloudflare (pull_request).

More: does it help, other systems, switches, what was read

Does it help: Unproven in play. The PR reports 15 interleaved 400 ms rounds on a Windows i7-9700 at 15e55f96. With 2, 4 and 6 threads, enabling the switch raised median take-plus-release time from 170.1, 366.5 and 587.0 ns to 218.5, 436.3 and 633.7 ns. The 4-thread ranges are separate, while the 2- and 6-thread ranges overlap. The separate owner-slot branch reports 56.0, 59.0 and 67.2 ns. Both sides of the standalone benchmark use the PR code, so it misses the default-path cost against main. No gameplay FPS, 1% low or frame-time results were supplied.

Other systems: The host scheduler runs on Windows and Linux across GPU vendors and Steam Deck. Guest synchronization, filesystem and video waits, and GPU waits all release and retake cores through this code. The switch can change their wake-up latency and frame pacing. Virtual-core counters and release attribution feed profiling and slow-frame diagnostics. No renderer API, save format, cache format, audio or input code changed.

Switches: HOS_VCORE_FAST is a developer-only attempt switch, read at startup and registered in switches.def and the developer reference. Unset or false keeps the locked scheduler. Off is the right default for the standalone experiment given the benchmark, though its default path still needs comparison with main.

Reviewed: e6acd10c72 against 6e1521a70a: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the Forgejo PR template, both revised test fixtures in full, and all changed host functions. Traced scheduler, affinity, TLS, thread startup and teardown, Linux lock and wait implementations, and affected source checks. Reviewed the changed switch rows and nearby rules, and skimmed other callers, profiling consumers and prior mask-0 run summaries. No local review-checklist file or Tooling checkout was present. Unrelated host sections and the full switch catalog were outside the review.; nothing run (a code review).

Checked and fine:

  • The main guest thread initializes the new switch before guest workers start.
  • The owner slots use atomic claims with the experiment enabled, including claims made under vc_lock. After a successful join, the teardown lock barrier drains scheduler readers that already saw the exiting owner.
  • The switch row is sorted, uses the host prefix and matches the developer reference. The revised fixtures scrub inherited HOS_ variables and run both switch modes.
  • No game data, build outputs, generated files or third-party changes appear in the diff. The commit has an Assisted-by trailer and the renderer API version rule does not apply.

Testing: Read-only review. The author reports Windows Clang fixture passes from a line-identical rebase and a changed-file suite with 44 passed, 11 failed and 4 skipped. The affected slow-frame assertion differs in outcome at source level and is called out above. The full suite and lint results, Linux GCC and Clang runs, and Tier 1 gameplay runs on current code are still needed. The supplied head CI checks were running.

Overlaps and merge order: #1860 changes the same duplicate fixture declaration. Keep one fix and rebase whichever lands second. Group perf/vcore-owner-lines (026a1abc) into this PR before measuring or merging the experiment.


Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The fast path races with affinity changes, TLS updates and scheduler diagnostics. The experiment also changes the default hot path, whose cost was never measured against main. Adds an opt-in virtual-core scheduler path that skips vc_lock on uncontended takes and releases. It preserves the common handoffs in the reported fixtures, but adds a second ownership protocol, more synchronization on the default path and new races when enabled. **`@fix` will do (14)** 1. **L1** `host/hos_thread.c:2117`: The mask used for validation is separate from the mask used to choose a core. (more on the line) 2. **L2** `host/hos_thread.c:168`: hos_thread_core reads vc_held twice with plain loads while the target can clear it atomically. A remote GetThreadCoreMask or pin_by_core can race a release. If the test sees a held core and the subtraction sees zero, it returns -1 and pin_by_core can shift by a negative count. Take one atomic snapshot here and audit the other cross-thread readers of vc_held. 3. **L3** `host/hos_thread.c:1932`: The fast taker samples the mask before acquiring tls_slot_lock. (more on the line) 4. **L4** `host/hos_thread.c:1883`: The fast mask-0 chooser reads the cached cell outside the lock used by vc_sync_tls_as. A same-core remask can pass its held check, then the target can release and start another take before the remask writes the cell. The preference read and pending write can overlap. vc_pref_core also reads vc_last while the fast taker can update it. Synchronize cache reads with writes and slot reuse, and use a synchronized snapshot for vc_last. 5. **L5** `host/hos_thread.c:2129`: The owner CAS exposes t before the fast taker initializes vc_held_at and vc_kick_at. (more on the line) 6. **L6** `host/hos_thread.c:2039`: vc_stats_locked reads takes normally and clears it with memset while fast takers can atomically add to it. A 64-take flush during the log call races the reset and can disappear. Keep takes outside the bulk reset and use an atomic exchange to capture the interval count. Flush each thread's final partial batch on exit so short-lived threads are counted. 7. **L7** (minor) `host/hos_thread.c:2299`: A fast release can free a slot and then lose the lock to a timed-out waiter. (more on the line) 8. **L8** `tests/test_slow_frames.py:127`: The source check still requires vc_grant(c, t) inside vc_release. That call exists at the merge base and is gone at HEAD. Even if the author's base run failed elsewhere, this assertion now fails on its own. Update it to cover attribution in both release paths, preferably by checking the resulting diagnostic behavior. 9. **L9** `tests/test_vcore_escape.py:312`: The release hook runs after the waiter has queued and entered sleep. (more on the line) 10. **L10** `tests/test_vcore_mask0.py:270`: The remask hook writes the field directly and calls vc_note_mask_change on the taker's host thread. (more on the line) 11. **L11** (minor) `tests/test_vcore_mask0.py:289`: Both revised fixtures default to clang++ when called directly. A Linux machine with only g++ fails the documented standalone command even with CXX=g++ set. Keep --cxx as the explicit override and use CXX and the runner's compiler fallback for direct invocation in both files. 12. **L12** (its part an edit can do) `host/hos_thread.c:2123`: Put owner slots on separate cache lines in the same patch and measure that revision against main. 13. **L13** (its part an edit can do) `host/hos_thread.c:2166`: Keep the existing synchronization and counter increments on the locked path where possible. Measure the remaining differences against the merge base. 14. **L14** (minor): The PR describes an unchanged default path and predicts no player-visible change. The unset path changes synchronization and logging, and the current benchmark cannot establish the impact. Describe those changes in Risks and label the measurement as a comparison of two modes of the same patched build. **For the author (2)** (a run, a measurement or a decision) - **L12** `host/hos_thread.c:2123`: The enabled standalone path loses in its own target workload. (more on the line) - **L13** (minor) `host/hos_thread.c:2166`: The benchmark calls the unset branch the main path, but both columns include the PR's sequentially consistent owner and held stores, atomic take counter and switch checks. (more on the line) **Checks:** Still running: `CI / Conventional Commit title (pull_request)`, `CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request)`, `CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request)`, `CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request)`, `CI / Workflow lint (actionlint) (pull_request)`, `CI / Website build and checks (pull_request)`, `Guide screenshots / Guide images and local UI source review (pull_request)`, `Third-party parts / As their notes say (pull_request)`, `Third-party parts / The same as upstream (pull_request)`, `Website / Website on Cloudflare (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven in play. The PR reports 15 interleaved 400 ms rounds on a Windows i7-9700 at 15e55f96. With 2, 4 and 6 threads, enabling the switch raised median take-plus-release time from 170.1, 366.5 and 587.0 ns to 218.5, 436.3 and 633.7 ns. The 4-thread ranges are separate, while the 2- and 6-thread ranges overlap. The separate owner-slot branch reports 56.0, 59.0 and 67.2 ns. Both sides of the standalone benchmark use the PR code, so it misses the default-path cost against main. No gameplay FPS, 1% low or frame-time results were supplied. **Other systems:** The host scheduler runs on Windows and Linux across GPU vendors and Steam Deck. Guest synchronization, filesystem and video waits, and GPU waits all release and retake cores through this code. The switch can change their wake-up latency and frame pacing. Virtual-core counters and release attribution feed profiling and slow-frame diagnostics. No renderer API, save format, cache format, audio or input code changed. **Switches:** HOS_VCORE_FAST is a developer-only attempt switch, read at startup and registered in switches.def and the developer reference. Unset or false keeps the locked scheduler. Off is the right default for the standalone experiment given the benchmark, though its default path still needs comparison with main. **Reviewed:** e6acd10c727c against 6e1521a70a32: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the Forgejo PR template, both revised test fixtures in full, and all changed host functions. Traced scheduler, affinity, TLS, thread startup and teardown, Linux lock and wait implementations, and affected source checks. Reviewed the changed switch rows and nearby rules, and skimmed other callers, profiling consumers and prior mask-0 run summaries. No local review-checklist file or Tooling checkout was present. Unrelated host sections and the full switch catalog were outside the review.; nothing run (a code review). **Checked and fine:** - The main guest thread initializes the new switch before guest workers start. - The owner slots use atomic claims with the experiment enabled, including claims made under vc_lock. After a successful join, the teardown lock barrier drains scheduler readers that already saw the exiting owner. - The switch row is sorted, uses the host prefix and matches the developer reference. The revised fixtures scrub inherited HOS_ variables and run both switch modes. - No game data, build outputs, generated files or third-party changes appear in the diff. The commit has an Assisted-by trailer and the renderer API version rule does not apply. **Testing:** Read-only review. The author reports Windows Clang fixture passes from a line-identical rebase and a changed-file suite with 44 passed, 11 failed and 4 skipped. The affected slow-frame assertion differs in outcome at source level and is called out above. The full suite and lint results, Linux GCC and Clang runs, and Tier 1 gameplay runs on current code are still needed. The supplied head CI checks were running. **Overlaps and merge order:** #1860 changes the same duplicate fixture declaration. Keep one fix and rebase whichever lands second. Group perf/vcore-owner-lines (026a1abc) into this PR before measuring or merging the experiment. </details> --- <sub>Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.</sub>
@ -1890,1 +1929,4 @@
did under vc_lock: with HOS_VCORE_FAST, t may have let c go and taken another core without the lock since; that take
stores vc_held before it writes the cell, and a release clears vc_held before it frees the slot) */
static void vc_sync_tls_as(HosThread *t, int c, int held_only) {
const uint32_t mask = vc_mask(t);
Member

L3: The fast taker samples the mask before acquiring tls_slot_lock. Pause it there, change a single-core mask to a multi-core mask that includes the held core, and let the setter clear the TLS cell. The taker can then acquire the lock and overwrite zero with core + 1 from its old snapshot. Sample the current mask under the TLS lock and use the same synchronization for the held-core validation and cell update.

**L3**: The fast taker samples the mask before acquiring tls_slot_lock. Pause it there, change a single-core mask to a multi-core mask that includes the held core, and let the setter clear the TLS cell. The taker can then acquire the lock and overwrite zero with core + 1 from its old snapshot. Sample the current mask under the TLS lock and use the same synchronization for the held-core validation and cell update.
@ -2026,0 +2114,4 @@
static int vc_take_fast(HosThread *t) {
if (__atomic_load_n(&vc_nq, __ATOMIC_SEQ_CST)) return 0;
if (t->vc_kick) __atomic_store_n(&t->vc_kick, 0, __ATOMIC_SEQ_CST);
const uint64_t mask = __atomic_load_n(&t->core_mask, __ATOMIC_RELAXED);
Member

L1: The mask used for validation is separate from the mask used to choose a core. A taker can snapshot core 0's mask, choose core 1 while the mask temporarily allows only core 1, and observe the original mask after the CAS. Both setters can see no held core, so neither side requests a move. The chooser also uses plain core_mask and ideal_core reads while affinity can change them. Choose from one synchronized affinity snapshot and validate the actual selected core against the current affinity after publishing the claim.

**L1**: The mask used for validation is separate from the mask used to choose a core. A taker can snapshot core 0's mask, choose core 1 while the mask temporarily allows only core 1, and observe the original mask after the CAS. Both setters can see no held core, so neither side requests a move. The chooser also uses plain core_mask and ideal_core reads while affinity can change them. Choose from one synchronized affinity snapshot and validate the actual selected core against the current affinity after publishing the claim.
@ -2026,0 +2120,4 @@
const int k = vc_free_for(t);
HosThread *none = NULL;
if (k < 0) return 0;
if (__atomic_compare_exchange_n(&vc_owner[k], &none, t, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) c = k;
Member

L12: The enabled standalone path loses in its own target workload. At four threads, the complete reported ranges are 407.6–464.3 ns with the switch enabled and 345.9–391.0 ns with it unset. Evaluate the owner-slot change together with this code against the actual base, in play, before merging.

**L12**: The enabled standalone path loses in its own target workload. At four threads, the complete reported ranges are 407.6–464.3 ns with the switch enabled and 345.9–391.0 ns with it unset. Evaluate the owner-slot change together with this code against the actual base, in play, before merging.
@ -2026,0 +2126,4 @@
__atomic_store_n(&t->vc_held, c + 1, __ATOMIC_SEQ_CST);
t->vc_last = c + 1;
t->vc_starved = 0;
t->vc_held_at = hos_now_ns(), t->vc_kick_at = 0; /* (vc_long_wait: how long a holder has held its core) */
Member

L5: The owner CAS exposes t before the fast taker initializes vc_held_at and vc_kick_at. A waiter can see that owner, set its kick time under vc_lock and have the taker race it or reset the timestamp to zero. The long-wait logger can also read vc_held_at during initialization. Publish initialized hold metadata and make accesses that can overlap a release or retake atomic or share a lock. Use atomic reads of vc_kick where the fast path can change it concurrently.

**L5**: The owner CAS exposes t before the fast taker initializes vc_held_at and vc_kick_at. A waiter can see that owner, set its kick time under vc_lock and have the taker race it or reset the timestamp to zero. The long-wait logger can also read vc_held_at during initialization. Publish initialized hold metadata and make accesses that can overlap a release or retake atomic or share a lock. Use atomic reads of vc_kick where the fast path can change it concurrently.
@ -2034,3 +2165,2 @@
AcquireSRWLockExclusive(&vc_lock);
vc_st.takes++;
int c = vc_free_for(t);
__atomic_fetch_add(&vc_st.takes, (int64_t)1, __ATOMIC_RELAXED);
Member

L13 (minor): The benchmark calls the unset branch the main path, but both columns include the PR's sequentially consistent owner and held stores, atomic take counter and switch checks. Compare the actual base with the corrected head in its shipping configuration and with the experiment enabled. Report FPS, 1% lows, median and p99 frame times and virtual-core waits on Windows, Linux and Steam Deck, including a busy scene on a low-core-count machine.

**L13** (minor): The benchmark calls the unset branch the main path, but both columns include the PR's sequentially consistent owner and held stores, atomic take counter and switch checks. Compare the actual base with the corrected head in its shipping configuration and with the experiment enabled. Report FPS, 1% lows, median and p99 frame times and virtual-core waits on Windows, Linux and Steam Deck, including a busy scene on a low-core-count machine.
@ -2140,0 +2296,4 @@
__atomic_store_n(&vc_owner[c], (HosThread *)NULL, __ATOMIC_SEQ_CST);
if (!__atomic_load_n(&vc_nq, __ATOMIC_SEQ_CST)) return;
AcquireSRWLockExclusive(&vc_lock);
if (!vc_holder(c)) vc_grant(c, NULL, t);
Member

L7 (minor): A fast release can free a slot and then lose the lock to a timed-out waiter. vc_settle grants the slot with no releasing-thread data, so a long wait can be reported as 'found free' or 'given at a release' without the thread that held it or its hold and kick times. Preserve release attribution when settling an already queued waiter, or document that fast mode drops it and distinguish those grants in the trace.

**L7** (minor): A fast release can free a slot and then lose the lock to a timed-out waiter. vc_settle grants the slot with no releasing-thread data, so a long wait can be reported as 'found free' or 'given at a release' without the thread that held it or its hold and kick times. Preserve release attribution when settling an already queued waiter, or document that fast mode drops it and distinguish those grants in the trace.
@ -240,0 +309,4 @@
/* a waiter and a release: the core goes to the waiter, asleep by then */
thread(&t, "waiter", 16, 1);
hook_thread = &h0, sleep_hook = gives_up;
Member

L9: The release hook runs after the waiter has queued and entered sleep. The fixture never forces two takers to claim the same free slot or a waiter to queue between a fast taker's two vc_nq reads. Replacing the fast CAS with a store or removing the post-CAS queue check would still pass these cases. Force both interleavings and assert one holder and timely handoff to the eligible waiter.

**L9**: The release hook runs after the waiter has queued and entered sleep. The fixture never forces two takers to claim the same free slot or a waiter to queue between a fast taker's two vc_nq reads. Replacing the fast CAS with a store or removing the post-CAS queue check would still pass these cases. Force both interleavings and assert one holder and timely handoff to the eligible waiter.
@ -231,0 +267,4 @@
thread(&t, "remask", 16, 0);
t.tls_slots[0] = 1; /* the guest cached core 0 */
M = &t;
wrapper_hook = [] { M->core_mask = 2; vc_note_mask_change(M); }; /* (in vc_pref_core: the choice) */
Member

L10: The remask hook writes the field directly and calls vc_note_mask_change on the taker's host thread. It catches removal of the final mask comparison, but bypasses hos_thread_affinity and cannot distinguish the production ordering from one with the fences removed. Drive the real setter and cover a concurrent remask, including a same-core update delayed across a TLS write.

**L10**: The remask hook writes the field directly and calls vc_note_mask_change on the taker's host thread. It catches removal of the final mask comparison, but bypasses hos_thread_affinity and cannot distinguish the production ordering from one with the fences removed. Drive the real setter and cover a concurrent remask, including a same-core update delayed across a TLS write.
futondestroyer left a comment

Recommendation: Request changes. The fast take can lose the mask-0 core preference, the scheduler races remain, and the standalone experiment slows its target microbenchmark.

New finding. At host/hos_thread.c:2147, the fast take overwrites the cached core before a detected change to mask 0 can act. A thread can leave core 0 with its cache still pointing there when an affinity change to core 1 arrives just as it enters a block. On return, it chooses core 1 and the setter restores mask 0 before the claim is published, so the setter sees no held core. The fast take detects the change and requests a checkpoint, but vc_sync_tls has already replaced the cached preference with core 1 when vc_yield asks vc_pref_core where to move. The checkpoint keeps core 1 even if core 0 is still free. Use one synchronized affinity and preference snapshot through the claim and retry selection before changing the cache if the snapshot changes. Cover the transition to mask 0 in addition to the existing test for a transition away from it.

The existing exact-head review also identifies the mixed reads in the affinity and held-core paths, stale same-core TLS writes, unsynchronized hold timestamps and take counters, and the stale slow-frame assertion. Exact main already delegates the grant from vc_release to vc_release_locked, so the assertion is already stale there. Update the fixture to follow the actual grant and the changed release signature. The transfer fixtures also leave the competing CAS and waiter-arrival windows untested. Existing exact-head review

Does it help? Unproven in gameplay. On the reported i7-9700 microbenchmark, median take-and-release time with the standalone switch enabled rose from 170.1 to 218.5 ns with two threads, 366.5 to 436.3 ns with four, and 587.0 to 633.7 ns with six. The four-thread ranges were separate. Both arms used the patched scheduler, so the benchmark leaves the shipping path's cost against main open. The reported owner-slot variant reached 56.0, 59.0 and 67.2 ns in the same setup. Fold the owner-slot change into this track before measuring the corrected revision against actual main with the switch unset and enabled. Owner-slot change

Other systems and switches. HOS_VCORE_FAST is registered as a developer experiment and defaults off. Unset still changes synchronization and counter operations. The scheduler serves guest waits and wakeups across Windows, Linux and Steam Deck, including NVN waits, and supplies the slow-frame and profiling diagnostics. In the usual teardown, the post-join lock barrier drains scheduler readers before freeing the exiting thread record.

Testing. The author reports Windows Clang fixture passes on an earlier rebase and 44 passes, 11 failures and four skips in the changed-file sweep. The saved Forgejo snapshot shows the description check passed and the relevant source checks pending. Gameplay and Linux host validation are outstanding. After the source fixes, compare main and the combined head with the switch unset and enabled, on the same scripted Market route and a busy outdoor route. Report average FPS, 1% lows, median and p99 frame times, and core-wait, escape and ownership diagnostics. Include a low-core-count system and Steam Deck in Tier 1 coverage.

Overlaps. The separate fixture cleanup touches the duplicate declaration. Keep one copy of that fix. Keep serial-core spinning out of this comparison so the scheduler effects remain attributable. Fixture cleanup · Serial-core spinning

Reviewed. Head e6acd10c727c3fefbd3981129756c58bd3c005eb against merge base 6e1521a70a32603ed60a8263e4072625885669b7. Read all five changed files at the touched areas, both fixtures in full, and relevant affinity, TLS, wait, lifecycle and statistics callers. Used revision-matched, local source-only Graphify maps and confirmed the findings in source. Longshot guidance 6e1521a7, Tooling 0b0059ac.

**Recommendation: Request changes.** The fast take can lose the mask-0 core preference, the scheduler races remain, and the standalone experiment slows its target microbenchmark. **New finding.** At `host/hos_thread.c:2147`, the fast take overwrites the cached core before a detected change to mask 0 can act. A thread can leave core 0 with its cache still pointing there when an affinity change to core 1 arrives just as it enters a block. On return, it chooses core 1 and the setter restores mask 0 before the claim is published, so the setter sees no held core. The fast take detects the change and requests a checkpoint, but `vc_sync_tls` has already replaced the cached preference with core 1 when `vc_yield` asks `vc_pref_core` where to move. The checkpoint keeps core 1 even if core 0 is still free. Use one synchronized affinity and preference snapshot through the claim and retry selection before changing the cache if the snapshot changes. Cover the transition to mask 0 in addition to the existing test for a transition away from it. The existing exact-head review also identifies the mixed reads in the affinity and held-core paths, stale same-core TLS writes, unsynchronized hold timestamps and take counters, and the stale slow-frame assertion. Exact main already delegates the grant from `vc_release` to `vc_release_locked`, so the assertion is already stale there. Update the fixture to follow the actual grant and the changed release signature. The transfer fixtures also leave the competing CAS and waiter-arrival windows untested. [Existing exact-head review](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1972#issuecomment-62391) **Does it help?** Unproven in gameplay. On the reported i7-9700 microbenchmark, median take-and-release time with the standalone switch enabled rose from 170.1 to 218.5 ns with two threads, 366.5 to 436.3 ns with four, and 587.0 to 633.7 ns with six. The four-thread ranges were separate. Both arms used the patched scheduler, so the benchmark leaves the shipping path's cost against main open. The reported owner-slot variant reached 56.0, 59.0 and 67.2 ns in the same setup. Fold the owner-slot change into this track before measuring the corrected revision against actual main with the switch unset and enabled. [Owner-slot change](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1973) **Other systems and switches.** `HOS_VCORE_FAST` is registered as a developer experiment and defaults off. Unset still changes synchronization and counter operations. The scheduler serves guest waits and wakeups across Windows, Linux and Steam Deck, including NVN waits, and supplies the slow-frame and profiling diagnostics. In the usual teardown, the post-join lock barrier drains scheduler readers before freeing the exiting thread record. **Testing.** The author reports Windows Clang fixture passes on an earlier rebase and 44 passes, 11 failures and four skips in the changed-file sweep. The saved Forgejo snapshot shows the description check passed and the relevant source checks pending. Gameplay and Linux host validation are outstanding. After the source fixes, compare main and the combined head with the switch unset and enabled, on the same scripted Market route and a busy outdoor route. Report average FPS, 1% lows, median and p99 frame times, and core-wait, escape and ownership diagnostics. Include a low-core-count system and Steam Deck in Tier 1 coverage. **Overlaps.** The separate fixture cleanup touches the duplicate declaration. Keep one copy of that fix. Keep serial-core spinning out of this comparison so the scheduler effects remain attributable. [Fixture cleanup](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1860) · [Serial-core spinning](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1974) **Reviewed.** Head `e6acd10c727c3fefbd3981129756c58bd3c005eb` against merge base `6e1521a70a32603ed60a8263e4072625885669b7`. Read all five changed files at the touched areas, both fixtures in full, and relevant affinity, TLS, wait, lifecycle and statistics callers. Used revision-matched, local source-only Graphify maps and confirmed the findings in source. Longshot guidance `6e1521a7`, Tooling `0b0059ac`.
@ -2026,0 +2144,4 @@
__atomic_store_n(&t->vc_kick, 2, __ATOMIC_SEQ_CST);
vc_wake_holder(t);
}
vc_sync_tls(t, c);
Member

A detected change to mask 0 can lose the original cached preference here. Let a core-0 thread give up its core after a remask to core 1 but before it services the kick. On its return from the block, it selects core 1. Have the setter restore mask 0 before the claim is published, while cached core 0 is free. The setter sees no core held. The taker requests a checkpoint but overwrites the cached preference with core 1, so vc_yield finds that it is already on its preferred core and drops the kick. Validate the selected core and the cached preference together before writing the cell, and retry with the current snapshot when they change. Please cover this transition to mask 0 in the fixture. Both cores are allowed under mask 0, so checking eligibility alone misses it.

A detected change to mask 0 can lose the original cached preference here. Let a core-0 thread give up its core after a remask to core 1 but before it services the kick. On its return from the block, it selects core 1. Have the setter restore mask 0 before the claim is published, while cached core 0 is free. The setter sees no core held. The taker requests a checkpoint but overwrites the cached preference with core 1, so vc_yield finds that it is already on its preferred core and drops the kick. Validate the selected core and the cached preference together before writing the cell, and retry with the current snapshot when they change. Please cover this transition to mask 0 in the fixture. Both cores are allowed under mask 0, so checking eligibility alone misses it.
siantm force-pushed perf/vcore-fast from e6acd10c72
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 14s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to c9d646dcb9
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
2026-11-21 04:23:28 +00:00
Compare
siantm changed title from WIP: perf(os): HOS_VCORE_FAST=1, virtual cores taken and released without vc_lock while no thread waits for one (experiment, off) to WIP: perf(os): virtual cores taken and released without vc_lock while no thread waits for one, each owner slot on its own cache line (HOS_VCORE_FAST, off) 2026-11-21 04:24:02 +00:00
Author
Contributor

Description updated for the push of c9d646dc (on main @ f1f2dc5b): the title and Summary cover both steps (#1973's commit folded in as its own commit, 1cde9675), this round's fixes, and what still differs from main with HOS_VCORE_FAST unset; Tested lists this head's checks (job fb3-1972-1); Measurements keeps the earlier micro-benchmark (step 1 alone a loss, both steps faster) and says its re-run on this head has not run yet.

Description updated for the push of c9d646dc (on `main` @ f1f2dc5b): the title and Summary cover both steps (#1973's commit folded in as its own commit, 1cde9675), this round's fixes, and what still differs from `main` with `HOS_VCORE_FAST` unset; Tested lists this head's checks (job fb3-1972-1); Measurements keeps the earlier micro-benchmark (step 1 alone a loss, both steps faster) and says its re-run on this head has not run yet.
Author
Contributor

Pushed c9d646dc (on main @ f1f2dc5b), with #1973's commit folded in as asked; #1973 is closed in favour of this PR.

On 62911 / 62912:

  • The remask back to mask 0: fixed in a6ca3685. A take without vc_lock now chooses from one read of the mask and, under mask 0, of the cached core (vc_aff); after its compare-and-swap and vc_held it reads both again and writes the TLS core cell in the same tls_slot_lock section (vc_fast_check), and if either changed it gives the core up and chooses again. tests/test_vcore_mask0.py drives your interleaving with the real setter on another thread (core 0 cached, remask to core 1 while away, back to mask 0 during the take) and expects core 0 and the cell naming it. It passes on this head. The fixture fails at the test commit 570f35da (its unset run already fails there on the cell-order case below, so its HOS_VCORE_FAST=1 run does not start), and with vc_fast_check's comparison taken out of this head's source the HOS_VCORE_FAST=1 run fails on this case (job fb3-1972-1).
  • BeanBot's points you confirmed: the mixed affinity and held-core reads, the stale same-core TLS writes, the hold timestamps and the take counters are in a6ca3685 (list in its message); the slow-frame assertion follows both release paths in ca0e9931, and tests/test_vcore_escape.py checks the long-wait cause each gives. The competing compare-and-swap and the waiter arriving between a take's two queue reads are now forced in tests/test_vcore_escape.py; with the compare-and-swap made a store, or the second queue read removed, it fails (run on mutated copies of the source in the same batch).
  • #1860 is still open, so the fixture fix for the duplicate hos_fps_timing stays here (61c51418); whichever lands second rebases.
  • With the switch unset the locked path now has main's stores, no fence and main's take count again; the description's Summary lists what still differs, and Measurements has a micro-benchmark of main against this head unset and set.
  • Not measured in play yet: the main / unset / set runs on the Market, a busy outdoor route and a route with queued core waits, low-core PCs and the Steam Deck are asked for with the person who does this PR's game runs, on this head.

On #1973's 62913 / 62914:

  • The padding is 1cde9675 here, unchanged.
  • The wait loop's three scans now test the waiter's affinity before they read a slot: c9d646dc. No check counts slot loads; the no-waiter micro-benchmark does not reach this loop, so the route with queued core waits is in the game runs above.
  • The inherited points are the fixes above (a6ca3685, ca0e9931).
Pushed c9d646dc (on `main` @ f1f2dc5b), with #1973's commit folded in as asked; #1973 is closed in favour of this PR. On [62911](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1972#issuecomment-62911) / [62912](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1972#issuecomment-62912): - The remask back to mask 0: fixed in a6ca3685. A take without `vc_lock` now chooses from one read of the mask and, under mask 0, of the cached core (`vc_aff`); after its compare-and-swap and `vc_held` it reads both again and writes the TLS core cell in the same `tls_slot_lock` section (`vc_fast_check`), and if either changed it gives the core up and chooses again. `tests/test_vcore_mask0.py` drives your interleaving with the real setter on another thread (core 0 cached, remask to core 1 while away, back to mask 0 during the take) and expects core 0 and the cell naming it. It passes on this head. The fixture fails at the test commit 570f35da (its unset run already fails there on the cell-order case below, so its HOS_VCORE_FAST=1 run does not start), and with `vc_fast_check`'s comparison taken out of this head's source the HOS_VCORE_FAST=1 run fails on this case (job fb3-1972-1). - BeanBot's points you confirmed: the mixed affinity and held-core reads, the stale same-core TLS writes, the hold timestamps and the take counters are in a6ca3685 (list in its message); the slow-frame assertion follows both release paths in ca0e9931, and `tests/test_vcore_escape.py` checks the long-wait cause each gives. The competing compare-and-swap and the waiter arriving between a take's two queue reads are now forced in `tests/test_vcore_escape.py`; with the compare-and-swap made a store, or the second queue read removed, it fails (run on mutated copies of the source in the same batch). - #1860 is still open, so the fixture fix for the duplicate `hos_fps_timing` stays here (61c51418); whichever lands second rebases. - With the switch unset the locked path now has `main`'s stores, no fence and `main`'s take count again; the description's Summary lists what still differs, and Measurements has a micro-benchmark of `main` against this head unset and set. - Not measured in play yet: the `main` / unset / set runs on the Market, a busy outdoor route and a route with queued core waits, low-core PCs and the Steam Deck are asked for with the person who does this PR's game runs, on this head. On #1973's [62913](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1973#issuecomment-62913) / [62914](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1973#issuecomment-62914): - The padding is 1cde9675 here, unchanged. - The wait loop's three scans now test the waiter's affinity before they read a slot: c9d646dc. No check counts slot loads; the no-waiter micro-benchmark does not reach this loop, so the route with queued core waits is in the game runs above. - The inherited points are the fixes above (a6ca3685, ca0e9931).
Author
Contributor

BeanBot 62391 and #1973's 62404, in c9d646dc:

  • L1 (#1973 L1, L2): one affinity read for the choice, checked again after the take, retry on change; mask and ideal core atomics; helpers take the mask read once (a6ca3685).
  • L2 (#1973 L3): hos_thread_core reads vc_held once; vc_last atomic (a6ca3685).
  • L3, L4 (#1973 L4, L5): the mask read under tls_slot_lock where the cell is written; with the switch on the cached core read there with its slot validated (a6ca3685; tests/test_vcore_mask0.py cases fail at 570f35da).
  • L5 (#1973 L6): kick and kick time cleared and hold time stored before the slot names the taker; those fields and vc_kick atomic where a waiter reads them (a6ca3685).
  • L6 (#1973 L7): fast takes in their own counter, taken with one exchange; a destroyed thread's last takes added (a6ca3685; checked in tests/test_vcore_escape.py).
  • L7 (#1973 L8, minor): such a grant is "found free" without the releasing thread, said in the comment above vc_fast; Tracy shows "given at a release" for a grant without a name (a6ca3685).
  • L8 (#1973 L9): ca0e9931.
  • L9, L10 (#1973 L10): the two compare-and-swap interleavings and vc_exited's lock pass forced in tests/test_vcore_escape.py; the mask cases drive hos_thread_affinity on another thread, including the same-core update against a take's cell write.
  • L11 (minor): --cxx, then CXX, then clang++/g++/c++ in both fixtures.
  • L12: the padding is folded in (1cde9675); L13, L14: the unset path has main's stores and take count again, Summary says what still differs, Measurements compares main, unset and set. Play runs are pending (Still to test).
BeanBot [62391](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1972#issuecomment-62391) and #1973's [62404](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1973#issuecomment-62404), in c9d646dc: - L1 (#1973 L1, L2): one affinity read for the choice, checked again after the take, retry on change; mask and ideal core atomics; helpers take the mask read once (a6ca3685). - L2 (#1973 L3): `hos_thread_core` reads `vc_held` once; `vc_last` atomic (a6ca3685). - L3, L4 (#1973 L4, L5): the mask read under `tls_slot_lock` where the cell is written; with the switch on the cached core read there with its slot validated (a6ca3685; `tests/test_vcore_mask0.py` cases fail at 570f35da). - L5 (#1973 L6): kick and kick time cleared and hold time stored before the slot names the taker; those fields and `vc_kick` atomic where a waiter reads them (a6ca3685). - L6 (#1973 L7): fast takes in their own counter, taken with one exchange; a destroyed thread's last takes added (a6ca3685; checked in `tests/test_vcore_escape.py`). - L7 (#1973 L8, minor): such a grant is "found free" without the releasing thread, said in the comment above `vc_fast`; Tracy shows "given at a release" for a grant without a name (a6ca3685). - L8 (#1973 L9): ca0e9931. - L9, L10 (#1973 L10): the two compare-and-swap interleavings and `vc_exited`'s lock pass forced in `tests/test_vcore_escape.py`; the mask cases drive `hos_thread_affinity` on another thread, including the same-core update against a take's cell write. - L11 (minor): `--cxx`, then `CXX`, then clang++/g++/c++ in both fixtures. - L12: the padding is folded in (1cde9675); L13, L14: the unset path has `main`'s stores and take count again, Summary says what still differs, Measurements compares `main`, unset and set. Play runs are pending (Still to test).
Author
Contributor

@Beanstalk This adds a switch, HOS_VCORE_FAST, off by default: with HOS_VCORE_FAST=1, virtual cores are taken and released without their lock while no thread waits, and each virtual core's owner slot sits on its own cache line (host/hos_thread.c). It has not run in the game yet. Please play Castle Town Market for two minutes, the PR against main on the same PC, on the PR's side with HOS_VCORE_FAST=1 and with it unset, on PCs with 6 or fewer logical processors (Windows and Linux), on a Windows PC with an AMD processor, and on the Steam Deck. No crash or hang, and no "ran without a core" line in the log; set, the log must have the line "vcores: takes and releases without vc_lock while nobody waits (HOS_VCORE_FAST)" and frame time p99 equal to unset or better, within the run-to-run spread; unset, frame times as main's.

@Beanstalk This adds a switch, HOS_VCORE_FAST, off by default: with HOS_VCORE_FAST=1, virtual cores are taken and released without their lock while no thread waits, and each virtual core's owner slot sits on its own cache line (host/hos_thread.c). It has not run in the game yet. Please play Castle Town Market for two minutes, the PR against main on the same PC, on the PR's side with HOS_VCORE_FAST=1 and with it unset, on PCs with 6 or fewer logical processors (Windows and Linux), on a Windows PC with an AMD processor, and on the Steam Deck. No crash or hang, and no "ran without a core" line in the log; set, the log must have the line "vcores: takes and releases without vc_lock while nobody waits (HOS_VCORE_FAST)" and frame time p99 equal to unset or better, within the run-to-run spread; unset, frame times as main's.
Member

@siantm only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@siantm only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Author
Contributor

The three renderer checks (test_present_queue_default, test_target_reuse_memory, test_vk_occlusion_queries) did not compile in the earlier run (no Vulkan headers on that job's path); rerun with them in job fb3-vk-1, at the head c9d646dc and on main @ f1f2dc5b: all three fail at both with the same first error, so they fail on main too; Tested's sentence and counts corrected.

The three renderer checks (`test_present_queue_default`, `test_target_reuse_memory`, `test_vk_occlusion_queries`) did not compile in the earlier run (no Vulkan headers on that job's path); rerun with them in job fb3-vk-1, at the head c9d646dc and on `main` @ f1f2dc5b: all three fail at both with the same first error, so they fail on `main` too; Tested's sentence and counts corrected.
Author
Contributor

Measurements: the take/release micro-benchmark on this head (c9d646dc) against main @ f1f2dc5b, job fb3-1972-1-bench: switch set 54-78 % less per take+release; unset, no difference measured (ranges overlap, medians 1-10 % higher). Micro-benchmark only, not play.

Measurements: the take/release micro-benchmark on this head (c9d646dc) against `main` @ f1f2dc5b, job fb3-1972-1-bench: switch set 54-78 % less per take+release; unset, no difference measured (ranges overlap, medians 1-10 % higher). Micro-benchmark only, not play.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'perf/vcore-fast:siantm-perf/vcore-fast'
git switch 'siantm-perf/vcore-fast'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1972
No description provided.