WIP: perf(nvn): HOS_NVN_NO_IDLE_AWAY=1 keeps the virtual core through an nvnWindowAcquireTexture with no pacing to sleep for (experiment, off) #1968
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1968
Loading…
Reference in a new issue
No description provided.
Delete branch "siantm/Longshot:perf/nvn-keep-core"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
nvnWindowAcquireTexture(host/nvn_native.c) gives the thread's virtual core up and takes it again around the frame'spacing (
hos_vi_native_acquire), also when there is nothing to sleep for. Given up and taken again around a wait of notime, the core can go to a waiting thread, and this one then waits for a core (up to a time slice when the holder's
priority is as good).
This adds an experiment, off by default: with
HOS_NVN_NO_IDLE_AWAY=1, a thread that holds its core keeps it through anacquire with no pacing to sleep for. Everything else goes as on
main:nn_vi.c'shos_vi_native_acquireis split intohos_vi_native_until(the pacing's deadline, 0 for no sleep) andhos_vi_native_sleep_until(the time left takenthen, the sleep counted as pacing in
hos_acquire_slept_ns); the acquire gives the core up around the latter, so thedeadline holds and the wait to take a core again stays out of the pacing's count, in the virtual-core counters;
hos_vcore_awayends an escape andhos_vcore_backtakes a free core after the call (hos_vcore_held,host/hos_thread.c, tells the two apart);nvnSyncWaitis not changed. The PR first also kept the core through a missed zero-timeout poll; that part wasdropped after review 62903 (the title now names only the acquire): the poll's second probe can flush queued work and
take the renderer's locks even at timeout 0, and can find the fence reached (
CONDITION_SATISFIED), so the secondprobe, its result and the handoff around it stay as on
main. The commit history still shows the dropped part (thefirst commit and its fix).
The switch is read once through an atomic (two first callers both store the same value) and said once in the log; its
row is in
gpu/vk/switches.def(kindattempt). Without it nothing changes, the pacing's split aside (the same sleep andcount, in two functions). With virtual cores off (
HOS_VCORES=0) no thread holds a core, and the switch changes nothing.From d1e33769 (the nvn-recordings integration) on
exp/x86-asm-sync, where it was on by default and not measured.Read first:
no_idle_awayandnvnWindowAcquireTextureinhost/nvn_native.c;hos_vi_native_until,hos_vi_native_sleep_untilinhost/nn_vi.c;tests/test_vcore_escape.py(nvn_cases).Testing
Tested: Windows 11, i7-9700, RTX 4060 (NVIDIA 610.88), llvm-mingw clang 23.1.5; game-free checks only. This change
has not run in the game on this PC yet, with the switch on or off (Still to test). Each check ran in a hidden console of
its own, in one job of the PC's job queue (fb3-1968-1), on this branch rebased onto
main@f1f2dc5b(head253596c4):python -I -B tests/test_vcore_escape.py(with--cxxllvm-mingw clang++ and with the compiler found fromLONGSHOT_MINGW): passes: the escape and starvation cases ("ok", "ok") and the NVN call sites withHOS_NVN_NO_IDLE_AWAYunset,0,off,1andyes, each "ok", each flipped after the first pass. At392604c3(thetest, before the fix) unset,
0andoffpass and=1fails: "an escaped thread's acquire with nothing to sleep fortakes the free core after it", "a missed poll probes twice and times out", "an escaped thread's missed zero-timeout
poll takes the free core after it", "a fence reached between the poll's two probes is satisfied", "a missed poll gives
the core up around its second probe and takes it again", "a paced acquire counts its pacing sleep alone, not its wait
for a core after it". On
main@f1f2dc5bthe check does not build (hos_fps_timingdeclared twice in its fixture);this PR removes the second declaration.
python -I -B tests/test_fps_stats.pyandtests/test_pacing_policy.py: pass.python -I -B tests/run_all.py --strict --changed origin/main(7 files changed, 100 checks read them; 8 at once): 85passed, 15 failed, 5 skipped. 12 of the 15 failing checks (
test_crash_dialog.py,test_crash_record.py,test_dev_ab.py,test_dev_packs.py,test_frame_overlap.py,test_host_guest_writes.py,test_libc_hooks.py,test_linux_pressure.py,test_mods_list.py,test_profiling_mode.py,test_slow_frames.py,test_vcore_mask0.py)fail on
main@f1f2dc5btoo, each run by name in the same queue's jobs. The other three(
test_present_queue_default,test_target_reuse_memory,test_vk_occlusion_queries) compiled nothing in that runnor in the run on
main(no Vulkan headers on the job's path: "not found: vulkan_headers (--strict)"). Rerun with theheaders (job fb3-vk-1,
RX_CPMset) at the head253596c4and onmain@f1f2dc5b, each fails at both with the samefirst error:
test_present_queue_default"srccut: '{TAB_DEBUG, "Present queue", &opts.present_queue, ...' is not ingpu/vk/vk_menu.cpp";
test_target_reuse_memory2 of its 8 tests ("'vmaGetAllocationInfo2' unexpectedly found" in theVMA source, and its fixture's "use of undeclared identifier 'destroy_image_later'");
test_vk_occlusion_queries"thering fixture did not compile" ("no member named 'policy'"). None fails on this branch alone.
Still to test:
main@f1f2dc5b, this PR unsetand with
HOS_NVN_NO_IDLE_AWAY=1, warmed and interleaved, two runs each, expecting the log line "nvn: the virtual coreis kept across an nvnWindowAcquireTexture with no pacing to sleep for" with it, average fps, 1% lows, median and p99
frame times and the virtual-core waits and escapes compared (by hand)
market for two minutes with
HOS_NVN_NO_IDLE_AWAY=1against unset, expecting frame times within the runs' spread orbetter and no stall (asked of the Test Farm)
Measurements
Not measured in play yet (Still to test):
HOS_NVN_NO_IDLE_AWAYships off (kindattempt), an experiment nothing measured yet chooses on; only game-free checks have run (Testing).Risks
Off, the acquire tests a switch read once, and the pacing's sleep runs through two functions instead of one (the same
deadline, sleep and count). On, a thread that holds its core keeps it through an acquire with nothing to sleep for: a
guest thread waiting for a core waits that much longer. A mistake there would show as a stall or a lower frame rate
with the switch on. Turn it off by leaving
HOS_NVN_NO_IDLE_AWAYunset; a revert is enough. Players notice nothing: theswitch is not set for them.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Recommendation: Request changes. The experiment can return a false fence timeout and introduces a shared switch cache with a non-atomic read. The scheduling gain still needs an in-game comparison against main.
The switch aims to spare the game thread a virtual-core handoff when a fence poll or texture acquire can finish immediately. The potential gain is less scheduler delay. The current patch also changes fence handling, shifts the timing of paced acquires, and makes pacing diagnostics less accurate.
@fixwill do (8)host/nvn_native.c:1197: The first zero-timeout Vulkan probe can miss a fence that completes before the second probe, including work submitted by the first probe's queue flush. (more on the line)host/nvn_native.c:1177: A first texture acquire can read v while a fence-poll thread writes it with InterlockedCompareExchange. (more on the line)host/nvn_native.c:1194: The new branch also depends on the existing unsynchronized HOS_NVN_SYNC_BLOCK cache. (more on the line)host/nvn_native.c:2661: With the switch on, VI computes the remaining sleep before releasing the core. (more on the line)host/nvn_native.c:2661: The switch moves hos_vcore_back inside the interval that hos_vi_native_acquire adds to hos_acquire_slept_ns. (more on the line)host/nvn_native.c:1195: The reported checks would still pass if the optimization were removed or if an enabled paced acquire stopped handing off its core. (more on the line)gpu/vk/switches.def:126: The unset text says every nvnSyncWait gives up the core. (more on the line)host/nvn_native.c:2660: Record handoff counts and reacquisition time separately for each NVN call site in the timing build, so the comparison can tell which path saves time and whether wait time moves to other guest threads.For the author (2) (a run, a measurement or a decision)
host/nvn_native.c:2660: The planned Market runs allow results within the spread and do not establish a gain or choose a default. (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),PR description / Description follows the template (pull_request_target).More: does it help, other systems, switches, what was read
Does it help: Unproven. The author reports 37 passed, 9 failed, and 3 skipped in Windows game-free checks on e332b851, with all nine failures also reported on
2e1f6c32. There are no in-game results for8e09b754against6e1521a7, or for the switch on versus off.Other systems: The fence path reaches Vulkan in both threaded and inline replay. Inline per-queue fences and queue batching matter because a zero-timeout call can check recording completion and flush work. The no-GPU fallback returns success at the first probe. Virtual cores are on by default on Windows and Linux, including Steam Deck. With virtual cores disabled, the switch still changes the fence result path. With pacing enabled, it changes where the core is released and which interval the FPS Breakdown, frame traces, and performance summaries count as sleep. No direct save, audio, input, VRAM, or build-path changes were found. Scheduling effects on other guest workers remain unmeasured.
Switches: Adds HOS_NVN_NO_IDLE_AWAY, an off-by-default host A/B switch registered as attempt. Off is the safer setting during development, but the repository requires measurements to choose the shipping default. HOS_NVN_SYNC_BLOCK is unchanged and bypasses the new fence shortcut.
Reviewed:
8e09b75447against6e1521a70a: Read AGENTS.md, CONTRIBUTING.md, the Forgejo PR template and developer standards in full. No docs/review-checklist.md was present, and the sibling Tooling checkout was unavailable. Read the complete diff and commit message, both changed NVN functions and their surrounding sync and window code, and the new switch row and its neighbors. Traced the relevant Vulkan replay, VI pacing, scheduler, Linux atomic shim, diagnostics and test code. Skimmed the rest of the switch table and related virtual-core run records. Unrelated portions of nvn_native.c and the dependency files were outside the detailed read. The diff has no generated files or translations. The prior Windows test logs and rebased-away head were unavailable for independent verification.; nothing run (a code review).Checked and fine:
Testing: Read-only review. No build, test or game run was performed. The author reports Windows source checks, including the switch-table check, on the earlier equivalent patch. The PR supplies no in-game or Linux build result, and CI is still running.
Overlaps and merge order: None found in the available refs. The cited exp/x86-asm-sync commit was unavailable locally, so its overlap and merge order could not be verified.
Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.
@ -123,6 +123,7 @@ SW(HOS_NVN_DEVINFO_LOG, diag, bool, "off", "Logs every nvnDeviceGetInteger querySW(HOS_NVN_HOLD, attempt, bool, "off: command buffers go to the replay at the submit", "Holds submitted command buffers until the queue is flushed, as NVN does.")SW(HOS_NVN_LOG_OBJECTS, diag, bool, "off", "Logs NVN object creation and setup calls.")SW(HOS_NVN_LOG_VMAP, diag, string, "off", "Logs virtual pools and the mappings into pools from the given GPU address (hex) up.")SW(HOS_NVN_NO_IDLE_AWAY, attempt, bool, "off: the virtual core is given up around every nvnSyncWait and nvnWindowAcquireTexture", "=1 keeps it across an nvnSyncWait poll of a fence not reached and an nvnWindowAcquireTexture with no pacing to sleep for (the pacing's sleep still gives it up); read once.")L7 (minor): The unset text says every nvnSyncWait gives up the core. An unfenced sync or a fence signaled at the first probe returns before the handoff, and HOS_VCORES=0 disables handoffs. Describe the handoff around the second wait and around acquire pacing when virtual cores are active.
@ -1178,6 +1192,11 @@ NV(nvnSyncWait) {if (rx_nvn_wait(s->fence, 0)) { RET(NVN_SYNC_WAIT_RESULT_ALREADY_SIGNALED); return; }static int block = -1; /* HOS_NVN_SYNC_BLOCK=1 (experiment): a poll waits for the GPU */if (block < 0) block = env_on("HOS_NVN_SYNC_BLOCK");L3 (minor): The new branch also depends on the existing unsynchronized HOS_NVN_SYNC_BLOCK cache. Two first-time nvnSyncWait callers on different guest threads can both write block while either reads it. Apply the same thread-safe initialization to this cache while touching the poll policy.
@ -1170,0 +1174,4 @@(vc_acquire: up to a time slice when the holder is as good). Read once, said once in the log */static int no_idle_away(void) {static volatile LONG v = -1;const LONG s = v;L2: A first texture acquire can read v while a fence-poll thread writes it with InterlockedCompareExchange. Volatile does not synchronize that read, including with the Linux shim's atomic CAS. Both callers can also read the environment before either publishes, and the loser returns its own candidate. Use an atomic cached load and a serialized first-use initialization, or read and publish the setting once during startup before guest threads run.
@ -1178,6 +1192,11 @@ NV(nvnSyncWait) {if (rx_nvn_wait(s->fence, 0)) { RET(NVN_SYNC_WAIT_RESULT_ALREADY_SIGNALED); return; }static int block = -1; /* HOS_NVN_SYNC_BLOCK=1 (experiment): a poll waits for the GPU */if (block < 0) block = env_on("HOS_NVN_SYNC_BLOCK");if (!block && !U64(1) && no_idle_away()) { /* (a poll: timed out already, the core kept; counted as before) */L6: The reported checks would still pass if the optimization were removed or if an enabled paced acquire stopped handing off its core. Add a game-free behavioral fixture with controlled fence results, a fake clock and observable core ownership. Cover a fence that completes between probes, a timed or forced-blocking wait, and acquires with and without a sleep, with the switch on and off. Use the configured compiler on Windows and Linux and set or clear the relevant environment variables in each case.
@ -1180,1 +1194,4 @@if (block < 0) block = env_on("HOS_NVN_SYNC_BLOCK");if (!block && !U64(1) && no_idle_away()) { /* (a poll: timed out already, the core kept; counted as before) */wait_note(1, hos_now_ns());RET(NVN_SYNC_WAIT_RESULT_TIMEOUT_EXPIRED);L1: The first zero-timeout Vulkan probe can miss a fence that completes before the second probe, including work submitted by the first probe's queue flush. The existing path can then return CONDITION_SATISFIED. The new path unconditionally returns TIMEOUT_EXPIRED, so the caller can defer work or poll again for an already-complete fence. Preserve the second probe and its result. The current renderer entry point can also take locks and flush submits at timeout zero, so keep the handoff on that path unless the renderer provides an explicitly nonblocking probe with an equivalent fallback.
@ -2641,3 +2660,1 @@const int away = hos_vcore_away();hos_vi_native_acquire(o->active ? o->active : o->ntex);if (away) hos_vcore_back();if (no_idle_away()) { /* (the pacing's sleep gives the core up when there is something to sleep for) */L8 (minor): The planned Market runs allow results within the spread and do not establish a gain or choose a default. Compare the merge base with the final head both on and off, using at least two warmed, interleaved runs per variant at matched settings in the Market and a heavy scene. Report average FPS, 1% lows, median and p99 frame times, and virtual-core wait tails and escapes. Cover Tier 1 NVIDIA and AMD on Windows and Linux and Steam Deck, including a low-core setup where keeping a core can delay a queued worker. Check displayed pacing as well as game frame times.
@ -2642,2 +2660,2 @@hos_vi_native_acquire(o->active ? o->active : o->ntex);if (away) hos_vcore_back();if (no_idle_away()) { /* (the pacing's sleep gives the core up when there is something to sleep for) */hos_vi_native_acquire(o->active ? o->active : o->ntex);L4 (minor): With the switch on, VI computes the remaining sleep before releasing the core. If the release waits for the scheduler lock, hos_sleep_ns still waits the original duration after that delay, even if the pacing deadline has passed. Keep the absolute deadline and recompute the remaining time after the handoff before sleeping.
L5 (minor): The switch moves hos_vcore_back inside the interval that hos_vi_native_acquire adds to hos_acquire_slept_ns. If another guest thread takes the core during a paced acquire, the FPS Breakdown and performance summaries now charge the reacquisition delay to pacing. End the sleep measurement before reacquiring the core and keep the scheduler delay in the virtual-core counters.
Recommendation: Request changes. Keep virtual-core recovery for an escaped guest at both NVN call sites. Leave the experiment in WIP until the fence behavior and switch initialization are corrected and the revised head has gameplay evidence.
New blocker at
host/nvn_native.c:2660and:1195. After a scheduler escape, a guest runs withvc_escapedset and no core. On main, a missed zero-timeout fence poll or an unpaced texture acquire still callshos_vcore_away(), which clears the escape and returns 1 so thathos_vcore_back()tries to take a core. With the switch enabled, both early paths bypass that retry. If a permitted core has become free, the escaped thread can repeatedly return to guest code without taking it. The scheduler'svc_yieldreturns immediately when the caller holds no core, and the guest core query can report the ideal core held by another thread. Preserve the recovery path when the thread has escaped, including nested-call behavior, and extend the existing escape fixture to exercise both call sites with a free core. Original escape recovery fixExisting findings independently confirmed. BeanBot's standing review covers the removed second fence probe, the non-atomic switch cache load, the inherited
HOS_NVN_SYNC_BLOCKcache, and the changed pacing deadline and accounting. The no-GPU backend succeeds on the first probe. The Vulkan entry point can flush queued submits or take locks even at timeout zero. If a fence completes between probes, main can returnCONDITION_SATISFIED; the enabled shortcut returnsTIMEOUT_EXPIRED. Keep the second probe and its result, and retain the handoff for any path that can block. Initialize the switch with synchronized access. On a paced acquire, account for the time spent waiting to reacquire a core separately from the pacing sleep and preserve the original deadline. Standing request for changesDoes it help? Unproven. The author reports 37 passes, 9 failures and 3 skips in selected Windows game-free checks on
e332b851, with the nine failures also reported on2e1f6c32. The author reports the patch was unchanged across its rebase. The selected checks do not cover this behavior. The captured exact-head Forgejo status has one successful description check, nine pending checks marked blocked by required conditions and one skipped website job. The PR has no gameplay result against6e1521a7, no measured gain with the experiment enabled, and no Linux build or game result in the evidence reviewed.Switch and affected systems.
HOS_NVN_NO_IDLE_AWAYis an off-by-defaultattemptregistered in the sorted switch table. Supplying it can change fence results even with virtual cores disabled. The positive pacing sleep still hands off a core throughsleep_away, and the texture index and acquire-sync initialization retain their existing behavior. The full behavior applies on Windows and Linux, including Steam Deck. Choose the shipping default with matched gameplay evidence. Build paths, renderer interface, generated files and third-party code are outside the diff.Related work. Virtual-core fast acquire/release and its stacked owner-slot layout change the cost of the handoff this experiment tries to skip. Serial reacquisition changes how long the same caller can wait for a core. Review each independently against main and remeasure this experiment if that scheduler policy changes first. The cited
exp/x86-asm-synccommitd1e33769was unavailable in the fetched history. Fast acquire/release, owner-slot layout, serial reacquisitionReviewed. Source-only read of exact head
8e09b75447cb8e7ee1fd3b75bcbeafdef357152aagainst merge base6e1521a70a32603ed60a8263e4072625885669b7. Both changed files and the complete diff, guest NVN dispatch, the Vulkan wait table and flush/recording paths, VI pacing and sleep, virtual-core scheduler and the escape fixture were checked in source. Revision-matched local Graphify maps validated at both commits. Their provenance and extraction logs document partial parses and indirect-call limits, so the dispatch and ownership were confirmed directly. Guidance was Longshot6e1521a7and Tooling0b0059ac. No build, test, or game run was performed for this review.@ -2641,3 +2660,1 @@const int away = hos_vcore_away();hos_vi_native_acquire(o->active ? o->active : o->ntex);if (away) hos_vcore_back();if (no_idle_away()) { /* (the pacing's sleep gives the core up when there is something to sleep for) */An escaped guest has no core to keep. On main, both this unpaced acquire and a missed zero-timeout fence poll use hos_vcore_away() to consume vc_escaped, then use hos_vcore_back() to take a now-free core. The enabled paths here and at line 1195 skip that retry. An escaped thread can keep returning to guest code without a core even after one becomes free, and its ideal core number can belong to another thread. Preserve escape recovery on both paths and add the no-sleep and missed-poll cases to the virtual-core escape fixture.
8e09b75447253596c484WIP: perf(nvn): HOS_NVN_NO_IDLE_AWAY=1 keeps the virtual core across NVN calls that do not wait (experiment, off)to WIP: perf(nvn): HOS_NVN_NO_IDLE_AWAY=1 keeps the virtual core through an nvnWindowAcquireTexture with no pacing to sleep for (experiment, off)Pushed
253596c4(rebased ontomain@f1f2dc5b; the PR's commit unchanged). After review 62903 the fence part is dropped (nvnSyncWaitas onmain: second probe, its result, the handoff), so the title now names only the no-sleepnvnWindowAcquireTexture; an escaped thread keeps its recovery; a paced acquire keeps its deadline and counts only its sleep as pacing; the switch is read through an atomic;tests/test_vcore_escape.pyruns both call sites. Summary, Testing, Measurements and Risks follow.@futondestroyer, on your review and inline, head
253596c4(rebased ontomain@f1f2dc5b; the PR's own commit unchanged,git range-diff"="):253596c4. The acquire keeps the core only while the thread holds one (hos_vcore_held); an escaped thread, or one inside an outer block, goesmain's way, sohos_vcore_awayends the escape andhos_vcore_backtakes a free core, and only the outermost block takes one.tests/test_vcore_escape.py(392604c3) now cuts the realnvnSyncWait,nvnWindowAcquireTexture, nn_vi.c's pacing andsleep_awayand runs them on the escape fixture with the switch unset,0,off,1andyes: an escaped thread's no-sleep acquire and its missed zero-timeout poll each take the free core after the call, and inside an outer block neither does. At392604c3, without the fix,=1fails both escape cases; unset,0andoffpass.main(its Vulkan entry can flush and take locks at timeout 0), nothing of it was left, sonvnSyncWaitis unchanged and the switch now covers only the no-sleepnvnWindowAcquireTexture(title and description changed to say so; the commit history still shows the dropped part). The fixture checks a fence reached between the probes answersCONDITION_SATISFIEDand a missed poll hands the core off.HOS_NVN_SYNC_BLOCK's cache is no longer touched by this PR and stays as onmain.hos_vi_native_acquireis split intohos_vi_native_until(the deadline) andhos_vi_native_sleep_until(the time left taken after the handoff, the sleep counted); the acquire gives the core up around the latter, so the deadline holds and the wait to take a core again stays out ofhos_acquire_slept_ns, in the virtual-core counters. The fixture holds the core with a rival for 3 ms after a 5 ms pacing sleep and checks 5 ms counted. At392604c3with=1it fails (the wait for the core counted as pacing); at the head it passes for every value.Checks:
tests/test_vcore_escape.py,test_fps_stats.py,test_pacing_policy.pypass;run_all.py --strict --changed origin/main: 85 passed, 15 failed, 5 skipped, all 15 failing onmain@f1f2dc5btoo. (test_vcore_escape.pyitself does not build onmain: its fixture declaredhos_fps_timingtwice; fixed here.)BeanBot's review, head
253596c4:nvnSyncWaitis as onmain(second probe, its result, the handoff).HOS_NVN_SYNC_BLOCK; its lazy cache is as onmain, left for a separate change.hos_vi_native_until/hos_vi_native_sleep_until).tests/test_vcore_escape.pyruns the real call sites with a fake clock and core ownership, the switch unset/0/off/1/yes in fresh processes and flipped after the first read; it fails with the switch on at the test commit.=1changes.@Beanstalk This adds a switch, HOS_NVN_NO_IDLE_AWAY, off by default: with HOS_NVN_NO_IDLE_AWAY=1 the frame pacing wait in nvnWindowAcquireTexture changes how it holds the thread's virtual core (host/nvn_native.c, host/nn_vi.c); unset, the pacing wait behaves as on main. 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_NVN_NO_IDLE_AWAY=1 and with it unset, on a Windows PC with an AMD processor, a Linux PC with an AMD processor, a PC with 6 or fewer logical processors, and the Steam Deck. No stall, hang or crash; set, frame time p99 equal to unset or better, within the run-to-run spread; unset, frame times as main's.
@siantm only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it or to this comment.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 head253596c4and onmain@f1f2dc5b: all three fail at both with the same first error, so they fail onmaintoo; Tested's sentence and counts corrected.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.