Threads and frame timing#
Forza Horizon splits a frame between two threads. The main thread runs the simulation and game logic and records what should be drawn as deferred commands (The executable); the render thread replays those commands into D3D and builds the GPU's command buffer. FMOD's mixer thread, the game's own audio thread and a pool of job workers that mostly run car physics do the rest. The console ran this at 30 frames a second on a 60 Hz display, and the timing rules below were written for that.
The parts that matter when changing the frame rate:
- The simulation is paced by the vblank, not by the present. Its callback raises the step event every second vblank, so a faster present alone does not make the game run more steps.
- The simulation's time step is measured from a millisecond clock, with a snap to 1/59.94 s for the common case and a single clamp for very long frames. A long stall is integrated as one large step.
- The render thread does not wait on an event when it has nothing new to draw: it loops through a zero, alertable
SleepEx. - The present waits for the GPU fence of the previous frame, so the main thread spends much of its time blocked there when the GPU is the bottleneck.
How Pinyon Shift changes this for 60 fps and higher is under Above 30 fps on the Runtime page; this page describes the game as shipped.
Thread map#
| Address | Finding | Confidence |
|---|---|---|
0x881ED4F00x881ED538v40x881ED4F00x881ED538 | XMedia facade thread creation and stack reuse fault The wrapper at 0x881ED4F0 calls ExCreateThread; 0x881ED538 is its return address. The Pixel 3 XL report in issue #556 faults in memset on the parent thread at that LR while a guest stack is initialized, not while a child fiber executes. The POSIX backend accepted relocated mmap results when old kernels ignored MAP_FIXED_NOREPLACE, leaving reused guard pages inaccessible. Exact-address validation and cleanup now preserve the requested stack commit. The reported GPU budget warning does not establish OOM as this fault's cause. Established by Import call analysis and normalized base/v4 function matching; report registers and runtime log; production POSIX allocator regression with the NOREPLACE flag stripped to simulate Linux before 4.17. | ConfirmedThe wrapper and allocator bug are confirmed; a current launch on the reporter's Linux 4.9.337 Pixel is still needed to confirm that this fixes their crash. |
8255AE10825A632082FB4AF882C0C8C8v4825CEC888261E31883075D1882CCC368 | guest thread census About 42 guest threads are live in a race. The busy ones are the main (simulation) thread 8255AE10, about 55 % busy and blocked in the GPU fence wait for most of the rest, the render thread 825A6320 at 39 %, FMOD's mixer thread (one of four FMOD threads started at 82FB4AF8) at 29 %, and eleven job workers started at 82C0C8C8. About fourteen other threads use about half a core together (see "other guest threads"). All hot work runs on ordinary threads; the title does not use fibers there.Established by Thread sampler over all guest threads for 15 s of the | ConfirmedShares are of recompiled code on a Ryzen 7 5800X, not console timings. The v4 entries are probable. |
825A62088255AE1082D4E2E082C0C8C882FB4AF882BAF5C8v48261E1788241D94882E1056082CCC36883075D1882C6DD70 | guest CPU by subsystem in a sustained race While driving with seven AI cars at 120 fps (simulation 112 steps a second), the guest threads are busy about 1.38 cores in all, not counting 82E4B2D0, which shows as busy but uses almost no cycles (a guest-side sleep). By wall-time samples: scene submission on the render thread (825A6208 and below) about 36 %, the simulation thread about 30 % (823E40D8 and 823E3218 15 and 13 % of it, 82E71F90 9 %), FMOD's mixer about 10 %, the game's audio logic (CAudioThread, 82BAF5C8) 8 %, and physics (the physics-world step 82D4E2E0 on the simulation thread plus the job workers at 82C0C8C8) about 11-14 %, about 1.5 ms of CPU a simulation step. Physics runs in large bursts outside the race: about 7 G cycles a second across the workers for two seconds while the event loads, and 37 % of the guest CPU in the festival before it. During the race intro (grid, countdown) physics is under 5 %. On the Odin (v4 build, the same route, holding its 60 fps limit: 16.67 ms mean, 0.3 % of frames over 17.5 ms), by cycles: scene submission 24.1 %, the simulation thread outside physics 23.9 %, FMOD's mixer 15.2 %, the audio logic 12.2 %, physics 6.9 %, the presentation worker 5.7 % and procedural geometry 5.2 %. Physics is half its desktop share there, and the two audio threads together are the largest single target after the render and simulation threads. On the Steam Deck LCD (base build, the same route from a Steam launch, at its 60 Hz limit: 16.9 ms mean), by cycles over 25 s of the race: scene submission 34.6 %, the simulation thread outside physics 22.8 %, FMOD's mixer 13.0 %, the audio logic 9.0 %, physics 7.7 %, procedural geometry 4.0 %, the presentation worker 4.0 % and the crowd 1.4 %. At the simulation thread's 2.56 GHz that is about 8.0, 5.3, 3.0, 2.1, 1.8, 0.9, 0.9 and 0.3 ms of CPU a frame; the guest threads use about 23 ms of CPU a frame in all, on a four-core CPU that is about 3.4 cores busy.Established by Thread sampler ( | ConfirmedDesktop shares, where none of these threads sets the frame (the GPU commands decoder does). Particles and crowds were not separated: their updates are not named and run inside the render and simulation threads' unnamed work. |
825A6320sub_825A6208sub_8259F3E8v48261E318sub_826164D0 | render thread The render thread (entry 825A6320) calls its frame function sub_8259F3E8 in a loop from sub_825A6208. In a race it spends 6.5-7.8 ms a frame, about 68 % of it waiting on GPU fences (10-11 waits a frame). The frame function's two indirect calls at 0x8259F4AC and 0x8259F4C4 are the hottest indirect call sites of the race (30.4 M calls each over the route, about 4,400 a frame) and each reached one target only (sub_823FA198, sub_8244A5C8): candidates for a guarded direct call.Established by Thread sampler and | ConfirmedCosts are of recompiled code on a Ryzen 7 5800X. |
82FB4AF8sub_82FBDF10sub_82F8F118sub_82F99BB8sub_82F9AAB8sub_82F97908v483075D18 | FMOD threads sub_82FB4AF8 is FMOD Ex's thread wrapper, and four guest threads start there. The wrapper loops: it calls its thread's update function through its one indirect call (0x82FB4B60), then sleeps through sub_82F97908. The four update functions, with their calls in a race, are the mixer sub_82FBDF10 (66,508, about three polls per 5.33 ms mix block), the stream and system update sub_82F8F118 (11,005), the file thread sub_82F99BB8 (11,118) and the nonblocking-open thread sub_82F9AAB8 (73). The mixer is the third busiest thread in a race, about 29 % busy on the desktop and 4.46 ms of CPU a frame on the Odin at 60 fps (4.86 ms for the four). It mixes the game's sound; XMA is compressed input that its codec decodes, not the output (see the audio page, "audio output path"). Its hottest functions are FMOD's reverb sub_8300D580 and ParamEQ sub_82FC6CC0.Established by Indirect targets of | ConfirmedThe mixer, file and nonblocking roles are confirmed by their strings; the stream role of sub_82F8F118 is probable (its thread is created in FMOD's init, which names the stream thread). The v4 address is the wrapper's; the update functions are not mapped. An earlier version of this record said the thread produced the title's XMA output. |
sub_82C0C8C8v482CCC368 | job worker threads Eleven guest threads start at sub_82C0C8C8. In a race one runs in 1.3-3 G-cycle bursts through sub_82D18D60 > sub_82D35390 > sub_82D18C90 > sub_82B8D9C0 > sub_82B8ED78, spread over the sub_82D2xxxx and sub_82CB6xxx families with no leaf above 7 %. Almost all of the workers' time is car physics. On the Odin, physics, collision and AI car simulation are 86 % of the workers' cycles and about 11.5 % of the whole process; 19 functions make half of the workers' time and 67 make 80 %, none of them named in these records. The burst job sub_82B8ED78 (slot 1 of an AsyncFunctionWrapperEx3 over CMLPMatrix<float>, 17 runs in a desktop race) averages 46 % of the workers but is idle in 31 of 41 seconds and runs in 6-10 one-second bursts of 1.2-1.9 G cycles; 98 % of its time is under the physics-world step sub_82D4E2E0 (CPhysicsWorld slot 22), whose own time is in CCarDynamics functions and 82CBxxxx math helpers. The CUpdateCarDynamicsAsyncParams job sub_82D4A000 (physics islands) averages 20 % and is 29-38 % of the workers in steady seconds. Covering 80 % of the physics time on the simulation thread, the workers and the bursts takes 131 functions (28.6 k generated statements), 117 of them outside any vtable. The hottest scalar floating-point ones that call no event, queue or allocation code are the tyre model sub_82D2F348 (see Car dynamics on the objects page) and sub_82D21DB0.Established by Thread sampler on the simulated low-spec run. Odin call-graph profiles ( | ProbableShares are of recompiled code at 30 fps on the Odin. The workers' cycle share (8.6 % of the process) and their simpleperf stat task-clock (about 75 ms a second) disagree, for a reason not found. The class names come from RTTI; that sub_82D4E2E0 is the step is probable. |
82E4B478sub_82E4B2D0sub_82E4B3A0sub_82E44470830C6918 | asset worker and background thread An asset worker thread does the decompression while loading: the LZX block decoder and the inflate loop are among its three hot functions. A background thread 830C6918 mostly formats text and allocates: its busiest leaves are the CRT printf engine (12 % of busy samples, about 1 % of a core in a race), the heap allocator (11 %) and a large load-heavy routine (11 %).Established by Thread sampler on desktop and on the simulated low-spec run. | ProbableThe records name the asset worker both as thread 82E4B478 and as sub_82E4B2D0. Both are thread entries: the Odin runtime log shows three guest threads starting at 82E4B2D0, 82E4B3A0 and 82E4B478. Which of them decompresses is not settled. Round 2 found that status helper 82E44470 polls pool bytes +1554/+1555 before taking the pool lock; workers 82E4B2D0 and 82E4B3A0 toggle those bytes. These are further shared-poll candidates, but were not the first observed replay value mismatch (docs/CLEAN_SLATE_STAGE0.md). |
82BAF5C882E217A082589AE8830C68B882E1C3E8829F662082463D60sub_8245DBE0v482C6DD7082EE37A0826000A083187E3882EDE52882AB359082493658sub_8248D438 | other guest threads Seven more threads use measurable CPU in a race; the figures are CPU a frame on the Odin at the 60 fps limit. 82BAF5C8 is CAudioThread (2.39 ms): through sub_82BAD518 it runs sub_82BAC498 once per rendered frame, which does the game's audio logic (CAudioEngine::Update, the car audio models) and the FMOD Event System update sub_82F50460. 82E217A0 builds procedural geometry: vegetation, models, characters (1.47 ms). 82589AE8 (through sub_82472908) is a presentation worker that runs the same deferred-command drain as the render thread and is a second producer of D3D segments and draws (1.23 ms; see "D3D draw entry points" on the rendering page). 830C68B8 is the XAudio2 pass (0.59 ms): through sub_8246E988 it runs sub_823F27E8 once per 5.33 ms audio block, mixing FMOD's output voice into the six-channel master (see "audio output path" on the audio page). 82E1C3E8 is a request worker (0.35 ms): it waits through WaitForSingleObject, then pops 24-byte requests from a queue under mutexes and serves them; about 91 % of its time is outside guest code, in the waits and mutex releases. A dead-work census (NR-4, 2026-11-16) found no unused output on it or on the other two minor threads: on the Deck LCD 82E1C3E8 costs 0.11 ms a frame, 829F6620 0.075 and 830C6918 0.02 (Odin v4: 0.18, 0.10 and 0.08 ms), and their cost is the wait path, not work that could be skipped. 829F6620 is D3D's predicated-tiling worker (0.23 ms; see "D3D GPU-to-CPU callbacks"). 82463D60 is XHV2 voice chat (0.16 ms): it ticks at 100 Hz, offline too, and polls four users a tick through sub_8245DD30 (46,036 calls in a race), which submits voice packets and checks headsets and sign-in. The tick is sub_8245DBE0 (v4 sub_8248D438), called once per period of the thread's 100 Hz periodic timer. Replacing it with nothing (NN-4.5) took the thread from 0.146 to 0.082 ms a frame and its instructions down 62 % on the Odin, in-run, with no effect on single-player play; the replacement also waits 50 ms so the thread wakes about 20 times a second.Established by Per-thread | ProbableConfirmed for the XHV2 thread (its imports) and the tiling worker; the other roles are probable. The times are the base image's on the Odin; same-build Odin runs spread by up to 23 %. |
82DBB740sub_82473090sub_823E91C0 | 82DBB740 pair is not a polling loop Two guest threads start at 82DBB740. On the desktop they looked like a polling pair (identical rates, about 92 % of their samples in NtWaitForSingleObject), but their loop sub_82473090 waits with an infinite timeout through sub_823E91C0 and then runs work, and on the Odin they have no samples in three race call-graph profiles. The desktop share is an artefact of the thread sampler, which charges each sample with the cycles used since the previous one, so a mostly parked thread looks as if it lives in its wait. Their role is not known.Established by Thread starts in the Odin runtime log; reading the generated code (the wait's timeout argument); Odin | Probable Negative |
sub_82E43888sub_82E438B8asset pool +112+1556 | exclusive disc IO bracket Nineteen functions that load in the foreground, among them the mission-flow XML loader sub_82617EC0, audio sub_82BB2490, sub_82D17048 and sub_82E50C68, name ExclusiveDiscIOLock and bracket their reads with sub_82E43888 and sub_82E438B8. These count up and down atomically at asset-pool +1556 and reset and set an event at pool +112 that the streaming workers 82E4B2D0 and 82E4B3A0 wait on, so background streaming pauses during a foreground read: a guard against DVD seeks.Established by String cross-references and the bracket functions' bodies in the generated code. | Probable NegativeMeasured on multivac (base, ce-load route from the 2026-09-27 seed): 102 entries per run, held 129 ms during boot, 102 ms from the title to free roam and 22 ms through car select into a race; 299 ms in all. Skipping both calls so streaming keeps running did not speed anything up and broke loading: the car-select thumbnails never arrived (the route timed out waiting for them), so the count or the event guards more than disc seeks. Rejected (CE-10). |
Main loop#
| Address | Finding | Confidence |
|---|---|---|
8255AE10sub_823ED8880x823EDA10v4825CEC880x8241DAD0 | main thread runs the simulation The main thread runs the simulation loop sub_823ED888 and also submits the scene. The site 0x823EDA10 is passed once per title frame and serves as the per-frame tick (frame.tick); there r28 is the frame root, whose word at +2404 is a route state and byte at +4168 a transition-active flag that the loop body reads right after, and r31 is the route root. A race step costs 4.6-5.1 ms, one step per frame at 120 fps. The loop is woken by the vblank callback (see the simulation vblank record), and much of its idle time is spent in the GPU fence wait.Established by Thread sampler and WPR profiles mapped to guest functions; a midasm hook on the frame site, with telemetry recording the two frame-root fields every 200 ms. | ConfirmedStep costs are of recompiled code on a Ryzen 7 5800X. The meaning of the route-state values is not established. |
0x823EE5840x824822640x8247D534v40x8241E6580x824B18A40x824ACB24 | main loop exit and teardown 0x823EE584 is where the title leaves its main loop. During teardown 0x82482264 checks a cleanup pointer at owner+684 and a wait loop at 0x8247D534 watches the same field; the pointer going from nonzero to zero marks a teardown of the running title state and the start of a new title generation.Established by Midasm hooks logging r29 to r31 at the exit, and on the cleanup check and the wait, detecting the teardown race. | ProbableThe exit site and the cleanup pointer are confirmed; the logged registers' meaning and the object owning the pointer are not. |
sub_82653300sub_82DD2B78sub_82801218 | other constant-step updaters Further per-update constant steps that run faster at higher frame rates: the showroom idle orbit sub_82653300 (0.1 degree per update at 0x8265354C), CAnimatedModelPresentation::Update sub_82DD2B78 (1/60 s at 0x82DD2B84) and the radio popup timer sub_82801218 (1/30 s at 0x82801384).Established by Static pass over the generated code; not hooked because no route reaches them. | Probable |
owner+448v4owner+448 | catch-up after long frames At 3x and 4x internal scale the simulation at times speeds up as if catching up. This fits the time step below, which integrates a long frame as one large step instead of capping it, rather than a clamp that replays lost time. Established by Play-test observation (2026-09-30) of frames longer than the title's step. | GuessNot traced in code. |
| — | v4 load and grid timing v4 adds one load hitch where the base game has none (3 invalid simulation deltas against 2 at the same hook site, on the pause and photo routes), and places the race grid more slowly, so a "vehicle moved" condition can be met while v4 still shows the countdown. Established by Same render-test routes on both builds from one seed. | Probable |
sub_823ED888sub_823E40D8sub_823E3218sub_82475310sub_82B77B18sub_825265B0sub_82526248sub_824D5818sub_82480C28sub_8264A258sub_82472168v4sub_8241D948sub_82414068sub_824131A8sub_824A4940sub_82C362B8sub_82590CD0sub_82590840sub_82543E70sub_824B0200sub_826F3240sub_824A18E0 | what the simulation loop spends its time on One pass of the simulation loop sub_823ED888 is mostly three calls. sub_823E40D8 (47 % of the thread on the Deck) is the simulation tick: 84 % of it is the world update sub_823E3218, which runs the physics-world step (sub_82D4E2E0, 40 % of the update), the AI drivers (sub_82475310, 17 %; through sub_82B77B18 into CMetaAIDriver, CPassingDriver and CAIDrivatar), sub_825265B0 (12 %, almost all in the tight loop sub_82526248, role unknown) and sub_824D5818 (9 %, car state handed to the car presentation: CCarDynamics getters and CCarPresentationDeferred). sub_82480C28 (30 %) reaches the user interface update, CUserInterface4 slot 48 (sub_82E71F90), through sub_8264A258, and sub_82472168 (11 %) is CUserInterface4 slot 50, the interface's scene-manager pass. So the user interface is about 41 % of the simulation thread and physics about a fifth.Established by Deck call graph of a sustained race (see "guest CPU by subsystem in a sustained race"), inclusive shares below each function; class names from the executable's RTTI vtables (slot = vtable index); v4 addresses from | ProbableShares are of the simulation thread on the Deck LCD at 60 fps; the desktop and Odin call graphs give the same order. |
sub_82412688sub_8243CB38sub_82E43EA8sub_82E4B240sub_82E4A030 | job completion polls race with worker state publication The job wait helper at 82412688 polls object bytes +40 and +41 before taking the job critical section. Its caller 8243CB38 then takes the critical section at object +4 and rechecks readiness. The poll may enter queue work selection through 82E4B240 and 82E4A030, which reads the clock while work is pending. The worker transition helper 82E43EA8 writes byte +40 under that critical section; the writer in this capture is asset worker 82E4B2D0. Round 2 session replay observed the same object at +40 as 3 instead of captured 4: the reader passed the worker's completion publication. Replaying kernel outcomes and per-object lock grants therefore does not determine this polling path. Established by Generated control-flow and field-access analysis; default-off read/store observations in desktop r2-race1 and r2-boot21, including the last matching writer's thread and sequence. A final repeat without memory observers still diverges at the same job lock versus another polling timebase read. No memory value was substituted by the diagnostic. | Confirmed |
sub_825A2CB8sub_8259F3E8sub_82649F20sub_82A6D640renderer +2072+2088v4sub_8261A100sub_826164D0sub_826F2F08 | loading screen minimum time When the tip loading screen (PLEASE WAIT with a tip) is shown, the renderer method sub_825A2CB8 (a vtable slot at 0x820032F0) sets a deadline at renderer +2088 under the renderer's lock: the render stopwatch (+2280) plus a minimum time on screen, a float at +2072. The render frame sub_8259F3E8 sets the deadline back to -1.0 once the stopwatch passes it, and the main thread's load step sub_82649F20 yields (sub_82A6D640, a thread-yield wrapper) while it is positive. The minimum is 1 s on the way from the title screen to free roam and 3 s into and out of an event; fast travel does not use it. On a disc the load outlasted it; from a modern drive it is most of the load on multivac: 1.0 s of the 1.56 s title-to-free-roam load, 2.9 s of the 4.62 s car-select-to-race load and 2.9 s of the 4.22 s retire to free roam. Pinyon Shift clears the deadline right after the method sets it (pinyon_shift_loading_screen_minimum, off by default), so the screen still appears and leaves when loading is done; race captures after the load were pixel-identical.Established by A host thread polling the renderer's fields and logging each deadline and duration; the main thread's stack in a hitch-sampler run of the title-to-free-roam load; the generated code of the setter and the waiter; A/B on the | Confirmed |
Session replay also depends on the instructions between kernel calls. The render thread polls a job state byte outside its job lock; a worker publishes completion under that lock. Replaying each thread's external results and lock grants left this read on the opposite side of the worker write. A deterministic runtime must order those shared-memory accesses or control the execution that reaches them.
Frame pacing#
| Address | Finding | Confidence |
|---|---|---|
sub_8247C6780x8247C6F00x832E12600x832E126Cv4sub_824ABBD80x824ABC500x833CCD200x833CCD2C | simulation steps on the vblank The simulation steps on its own vblank callback sub_8247C678, not on the swap. The callback counts guest vblanks and raises the simulation event every second vblank under the title switch mainthread30fps (decision at 0x8247C6F0), so the simulation ticks once per two vblanks whatever the frame rate: the console ran at 30 fps on a 60 Hz vblank, with a present interval of ONE. When a frame spans more vblanks, the next frame runs extra steps. With a vblank ticking at 1 kHz the title ran 500 steps a second, and on screens where a step is expensive (race central's paused screens) each frame spanned ever more vblanks. With a correct vblank and frame-rate limits of 30, 60 and 120, free roam ran at 30.1, 59.4 and 117.5 fps with a simulation-to-wall ratio of 1.01. The count of vblanks since the last raise is the word at 0x832E126C; a raise sets the event whose handle is at 0x832E1260 (through sub_8247AF78, a wrapper of NtSetEvent) and zeroes the count. Setting that event and zeroing the count from host code raises a step exactly as the callback does (the #381 step gate does this at a swap).Established by Reading the generated code; the step gate's raise from the swap, which the main loop answers with one step; simulation ticks per frame in performance logs (2.3 steps per 18 ms frame at a 240 Hz vblank); a play-test log (50-80 steps in a 110 ms frame against 1-4 normally); a render-test route counting vblanks and steps per frame (10 and 5 before the vblank fix, 2.3 and 1.15 after); free-roam medians per limit. | Confirmed |
sub_823ED8880x823EDB84owner+448v40x8241DC44owner+448 | simulation time step The simulation loop reads elapsed time from a millisecond clock as an integer (8 or 9 ms a tick at 120 Hz). 16 or 17 ms snaps to 1/59.94 s with a residual accumulator; the only clamp turns an elapsed time above 4000 ms into 16 ms, and the step (f31, in seconds) is held to at least 0.0001 s. A long frame or fence wait is therefore integrated as one large step. The step is stored at owner+448 (0x1C0) at 0x823EDB84, before the update systems run; the offset is unchanged in v4. When the title thread or the guest GPU frame sits at a two-vblank budget, the loop runs two ticks in the same millisecond and then none for 17 ms while frames still reach the display evenly, which reads as hitching (worst after a retired race); the guest clock, guest vblank pacing (steady 4.17 ms) and a display-rate mismatch were ruled out as causes. The cause is that steps and frames are paced apart: see the step and frame pairing record.Established by Reading the generated code; a hook reading | ConfirmedFB-0.3 gives the snap as 1/60 s. |
sub_823ED888sub_82465EB80x823EDAA80x829EFEB8v40x8241DB68 | step and frame pairing After its per-frame tick, unless the transition flag at +4168 is set, the main loop waits on the vblank step event (sub_82465EB8 with the handle at 0x832E1260) and then, from 0x823EDAA8, reads its millisecond clock and runs one step. Nothing ties a step to a frame: the event comes every second vblank, and the render thread builds a frame from the newest finished step and swaps (VdSwap at 0x829EFEB8). When the render thread takes longer than two vblanks (a guest GPU frame of 10-13 ms at the 120 fps limit and 2x), the main loop keeps stepping every 8.3 ms and the render thread skips a step every second or third frame; when the two drift in and out of phase, a frame gets no new step. Counting steps started between consecutive swaps on the race route at 2x and 120 fps: 86-91 % of frames got exactly one step, 5-8 % two (motion skipped) and 3-6 % none (a frame shown twice), with game time off the wall time between swaps by over 4 ms in 9-14 % of frames; free roam was 83 % one step and 16 % off. Holding the raise while the main loop is two steps ahead of the swaps, and raising it at the next swap, gives 98.6-99.8 % one step per frame and 1.5-2.5 % off on the base and v4 builds (99.6 % and 1.8 % in free roam).Established by A per-swap counter of steps started (the delta hook at | ConfirmedThe performance CSV's simulation_tick_count counts the per-frame tick at 0x823EDA10, before the step wait, so it can read 0 and 2 on alternate presents while every present carries one step; judge pacing by steps per swap or by simulation_time_ns. Holding the main loop at 0x823EDAA8 until the swap instead (in the v4 build 0x8241DB68) also stopped the skips but moved every step onto the swap's timing: at 60 fps the game time per frame strayed more than without the gate. The vblank callback runs inside the global critical region, so the host raise at the swap must not hold a lock the callback's gate takes: the first build looked up the event under the gate's mutex and deadlocked the vblank and render threads after about 28 minutes of play. |
sub_8259F3E80x8259FBEC0x8259F80Csub_823E6738v4sub_826164D00x82616CD40x826168F4sub_82416708 | render thread idle path When the simulation has no new frame for the render thread (its frame counter has not passed the one last drawn), the render thread frame takes an idle path: the gamma transition (sub_82586CD8), a time read, then SleepEx(0, TRUE) returning to 0x8259FBEC. A zero alertable sleep returns at once on the host, so this path runs back to back while the render thread waits. An optional spin earlier in the function runs only when the renderer's field at +3244 is non-zero: that field is a delay in microseconds, and the function reads its timer (the thunk sub_823E6738, which calls the timer object's function at +88) until that much time has passed; the loop's timer call returns to 0x8259F80C. At Press Start the render thread uses 912-983 ms of CPU a second on the Odin (at 60 fps) and the idle path above hardly runs (3,676 idle sleeps in 105 s against 142,622 in a race), but that time is not this timer loop: the timer thunk runs only 270-370 times a second there, sleeping 200 µs before each read changed nothing, and in a cycles profile the time sits in the frame function's own code (29 %) and its drawing callees. A second profile on another build put the frame function's own time in its 16-pass loop at 0x8259F498, two virtual calls a pass on the object held in r27; 32 indirect calls cannot take a third of a 16.7 ms frame once, so at Press Start the frame function itself runs back to back many times per displayed frame. Throttling that needs a frame-pacing change, not a sleep in a timer read.Established by Odin call-graph profile ( | Confirmed |
sub_823F4B300x823F4F60sub_82416A00v40x82424FB0 | render job queue backpressure When the render job queue is over its threshold, the producer sub_823F4B30 waits in a loop that yields each iteration, up to twice the threshold ahead, with a counter at 84(r1) running down from 1000; after 1000 yields it posts anyway. On the console that escape implied a real stall. On a fast host the producer can overfill the render thread's 12 slots, ending in an access violation in sub_82416A00 or a hang.Established by Midasm hook before each yield at | Confirmed |
Present and fences#
| Address | Finding | Confidence |
|---|---|---|
sub_829EEC48sub_829EED780x829EEE44v40x82AABDB4 | vblank and swap interrupts The D3D vblank handler sub_829EEC48 bumps the vblank counter, completes queued swaps whose target vblank has arrived and sets an event. The swap interrupt sub_829EED78 moves a swap to the next vblank when it arrives more than 20 % of a display period after the latest one, so frames land on whole vblanks: at 0x829EEE44 it compares the lateness (r7, percent of a display period) with the threshold (r27), with r8 the previous swap's target vblank and r10 the current count. With the guest vblank at twice the render limit, a late frame waits for the next one. Immediate flips do not update the title's last-flip time at +16964, which its video player reads.Established by Reading the generated code; a timing trace (DR-5.2); a midasm hook at | Confirmed |
sub_829F04A8sub_823E91F0v4sub_82AAD418 | GPU fence-wait predicate Seven D3D fence-wait loops (sub_823E91F0 among them) call sub_829F04A8 while the fence word at 0xFFCA4000 in the 0xE0000000 physical view has not reached their target. The wait record (r3) holds the device at +0 and the last fence value at +8; the device keeps the fence-word pointer at +11024 (written by the GPU's EVENT_WRITE_SHD) and a lost-device flag in bit 1 of byte +11069. The predicate busy-polls briefly and has its own no-progress timeout and kick logic. It ran about a billion times per fh1-race-sync run: the title spends about two thirds of its time busy-polling, about 9.9 ms per race frame. The render thread's fences were at physical 0x1FCA5002/0x1FCA5006.Established by Midasm hook at the entry that blocks until the next GPU write (about 100,000 waits per run, 88 % ended by the signal, process CPU 15 % lower); a trace of every fence wait loop; race frame cost breakdowns (5.4-9.9 ms of a race frame on our renderer). | Confirmed |
| — | command-stream synchronization through memory The title's GPU command stream uses WAIT_REG_MEM packets that poll memory the title writes, and EVENT_WRITE_SHD stores that the title polls, so the CPU and GPU sides are ordered through words in guest memory.Established by Profiling of the GPU command thread and the design study for moving packet decoding off it. | Probable |
sub_82AE8AE0 | presentation parameters at start sub_82AE8AE0 fills the 92-byte presentation parameters at start and multiplies the video mode's refresh rate by a constant into obj+68. It is not a per-frame animation stepper.Established by Reading the generated code during the search for frame-rate-dependent steppers. | Probable NegativeNP-3.7 listed it, with the consumers of the main-loop delta at owner+448, as a candidate for a per-frame-stepped NPC or title-UI animation; PB-4.3 found it only fills the parameters, but it remains the first candidate for a refresh-derived step. |
Hot functions#
These are the guest functions that take the most time in thread-sampler, WPR and simpleperf profiles of races and free roam on desktop and Android (Methods and tools). Knowing them tells a performance investigation where generated code matters.
| Address | Finding | Confidence |
|---|---|---|
sub_830F2210v4sub_831B4090 | LZX block decoder Decodes LZX symbols into a sliding window until the requested length is produced; about 20 % of the asset worker's time while loading. Decoder state: +0 window, +8 window mask, +12/16/20 repeated offsets R0-R2, +24 main symbol table, +2072 length table, +2584 main code lengths, +3256 length code lengths, +3508 aligned table, +3636 aligned lengths, +3644 and +9020 overflow trees, +11012 input pointer, +11016 input end, +11952 bit buffer, +11956 bits left (signed byte), +11960 window position, +12004 extra bits per position slot, +12056 position slot bases. Copies of 16 or more bytes use 16-byte chunks that may write up to 16 bytes past the match; the last store keeps destination bytes through a select constant (0x822D5360, v4 0x822E8480).Established by Reading the generated code; a native port compared window, state and return value on every call of a route (0 mismatches in 17,535 calls). | Confirmed |
sub_83108C08 | inflate loop A deflate decoder loop. About 20 % of the asset worker during loading, but only one sample in about 1,160 across a sustained race, so it matters only for load times. Established by Thread sampler on desktop and on the simulated low-spec run. | Confirmed |
sub_8300D580v4sub_830CE6C0 | audio reverb FMOD's SFX (I3DL2-style) reverb on the mixer thread, in FMOD's Xbox 360 reverb core: 2,230 generated lines with the same shape in v4; 12.3 % of the v4 mixer thread on the 8 Elite and 2.3 % of the whole process on the Odin (0.91 runs per mix block). Only part of it depends on the channel count: its delay-line loop is bounded by a reverb-state count (about 38 % of its samples), and the per-channel output loop and a six-channel input pass are about a quarter, so a stereo mix would save only about 17-27 % of it. Established by Shape match across both images and | ConfirmedConfirmed as FMOD's SFX reverb core; the v4 match and the per-loop shares are probable. |
sub_82FC6CC0sub_82FC7A00sub_82FC6BD0sub_82FC7880sub_82FC7A48v4sub_83087D70sub_83088AB0sub_83087C80sub_83088930sub_83088AF8 | FMOD ParamEQ (six-channel biquad) Most likely FMOD's ParamEQ unit: it sits between FMOD's pitch-shifter and ParamEQ unit descriptors. A fused multiply-add chain over float filter state, with separate loops for one, two, six and eight channels; 98.5 % of its Odin time is in the six-channel loop (36 multiplies a sample against 12 in the stereo loop), because FMOD mixes in 5.1 (see "speaker mode and the 5.1 mix" on the audio page). It runs 7.1 times per mix block: 1.3 % of the Odin process and 8.9 % of the v4 mixer thread on the 8 Elite.
Its contract, which the NN-4.3 twin implements: it is FMOD Ex's DSP read callback, reached only indirectly through the thunk Established by Shape match and | ProbableThe descriptor placement makes ParamEQ probable; the field layout and the filter are read from the generated code. The NN-4.3 twin (src/guest_native/fmod_dsp.cpp, pinyon_shift_fmod_native_parameq, on by default) confirms the contract: with its verify on every call of an Odin race, 335,872 calls matched the original within 60 dB (30 raced with the game thread's parameter setters), and the in-run A/B took 0.141 ± 0.047 ms a frame (5.7 %) off the FMOD mixer thread. |
sub_82A6D7D8sub_82A6D748sub_82E2F0B0sub_82BAC498sub_82BB3E48sub_82E386B8sub_82D18588v4sub_82B2A848sub_82B2A7B8sub_82EF10C0sub_82C6ACF0sub_82C72708sub_82EFA628sub_82DDA4B8 | SleepEx wrapper and its spinners SleepEx (sub_82A6D7D8) takes milliseconds in r3 and alertable in r4, calls the KeDelayExecutionThread wrapper (sub_82A6D748) and maps STATUS_USER_APC to 192. It was called about 5.4 million times in one fh1-race-retire run, before the render thread's idle path was replaced. Besides that path, SleepEx(0, TRUE) spin loops sit in sub_82E2F0B0, sub_82BAC498, sub_82BB3E48, sub_82E386B8 and sub_82D18588. With the idle path replaced they spin rarely: in a desktop race the guest SleepEx ran 234 times a second in all and sub_82D18588 never ran, and on the Odin none of the five took more than 0.01 % of the process.Established by Code shape matched across both images; call counts from the native replacement's summary and from the probe build (NL-2.3, 115 s race); Odin call-graph profiles (30 fps). | Confirmed |
sub_82462030sub_82462050sub_82462098sub_823E6738 | guest time reads The lowest helper 82462030 reads the PPC timebase, mapped to the runtime guest tick counter. The other helpers use it for time queries and timer setup; most of the render thread's clock reads in its idle loop come through them. Established by Call graph and generated timebase access; same-binary mapped host stack in r2-race-no-watch. | Confirmed |
sub_823F18B80x82000960 | GetTickCount reads KeTimeStampBundle sub_823F18B8 is the title's GetTickCount: it loads the kernel variable import at 0x82000960 (KeTimeStampBundle) and returns the bundle's millisecond tick count at offset 16. 287 functions call it and 56 of them ran in a desktop race, about 1.03 million calls (8,900 a second). The top callers are FMOD's sub_82F978D0 (601,480) and sub_82F97848 (168,050) and the game's sub_82C615D8 (268,271) and sub_82BFC840 (85,938); the simulation loop sub_823ED888 calls it once, before its frame loop. So the title reads the bundle, FMOD included, and refreshing it less often than the SDK's 1 ms would change what these callers see.Established by The generated code (the import-slot load and the offset read); the slot is one of the variable records in the executable's | ProbableThis answers NN-3.7's premise: stopping the SDK's 1 kHz bundle timer is not free, because the title reads the bundle. The slot's name rests on the loader's label, not on an ordinal parsed here. |
sub_82452358 | CRT printf format engine The C runtime's formatted-output engine: 1,800 generated lines whose compares are format characters (*, x, X, g, I32/I64, flags -+#). The busiest leaf of the background thread 830C6918 (12 % of its busy samples, about 1 % of a core in a race).Established by Compare constants in the generated code; thread sampler on the simulated low-spec run. | Probable |
sub_82470CB0 | guest heap allocator Takes a critical section and calls NtAllocateVirtualMemory, and KeBugCheckEx on failure. 11 % of the background thread 830C6918's busy samples, but in a race only 0.05 % inclusive.Established by The imports it calls; thread sampler; | ProbableAn earlier version listed sub_8246F268 (0.52 % inclusive) as this allocator's neighbour. It is unrelated: it is the audio render-driver callback, which calls KeSetEvent, KeWaitForMultipleObjects and XAudioSubmitRenderDriverFrame (see "audio output path" on the audio page). |
sub_82465EC0sub_82465EB8sub_823E91C0sub_8247AF78sub_823E5340sub_8246F540 | synchronization wrappers The title's XAPI wait and signal wrappers, the busiest guest calls into the kernel in a race. sub_82465EC0 wraps NtWaitForSingleObjectEx (3.39 million calls in a desktop race, about 29,400 a second); sub_82465EB8 is WaitForSingleObject, which jumps to it with alertable 0 and brings 99.9 % of those calls, and sub_823E91C0 wraps WaitForSingleObject again (399,765 calls). sub_8247AF78 wraps NtSetEvent (2.25 million), sub_823E5340 NtReleaseMutant (2.09 million) and sub_8246F540 KeWaitForMultipleObjects (21,572, about one per 5.33 ms audio block). The waits block rather than poll: every hot caller passes an infinite timeout (the threads 82E1C3E8, 82E217A0, 82463D60 and 82DBB740, sub_82467B18 on thread 83136C18, sub_82D4DCC8, the job workers, the asset worker and the render thread). The exceptions are CAudioThread's 40 ms wait and the CTransferManager thread 82C204B8, which calls sub_82465EC0 directly with a 32 ms alertable timeout. On the Odin the wait wrapper is about 1 % of the process, most of it the SDK's handle lookup and wait path.Established by The import each wrapper calls and the timeout argument at each hot call site, read from the generated code; call counts from the probe build (NL-2.3, 115 s race); Odin call-graph profiles (30 fps, three runs) split by caller and host mechanism. | ConfirmedResearch notes, not these records, once blamed the 29,400 waits a second on CTransferManager polling. That thread's polling was the SDK's 1 ms alertable wait loop, which #463 (E1) removed; it now waits 32 ms at a time and is about 0.06 % of the Odin process. |
sub_8307EDA8sub_83048F00 | large load-heavy routine 12,000 generated lines, mostly loads, stores and byte moves, with 16 calls to sub_83048F00. 11 % of the background thread 830C6918 and 4 % of the asset worker; its profile is flat.Established by Thread sampler. | Guesspurpose unknown |
sub_8282EA800x8282EAB00x8282EAC0v40x82D19DE8 | 16-byte array release walk sub_8282EA80 releases a {begin, end, capacity} array of 16-byte elements with trivial destructors: it steps a pointer from begin to end doing nothing, then frees begin, so jumping straight to the free is equivalent. The empty walk took about a fifth of a streaming worker thread.Established by Thread sampler; a midasm hook at | Confirmed |
sub_82526248sub_823F4B30sub_824168B0v4sub_824701B8 | other hot leaves No guest function is a dominant hot spot in a race. The next largest leaves are sub_82526248 (per-object matrix math, 2.3-2.9 % of the simulation thread), the render job producer sub_823F4B30 (2.3 % of the simulation thread on a slow 4-core part) and sub_824168B0 (2.0 % of the render thread). In v4 the render thread's top leaf is sub_824701B8, a branchy draw-state routine (5.4 %).Established by Thread sampler and WPR profiles on desktop and simulated low-spec runs; | Confirmed |
—v4sub_82E10560sub_82E100B0sub_82E08FF8sub_82DFC608sub_82DFC570 | car physics call chain On the v4 drive the car physics runs on the main thread (825CEC88) and on a job worker (82CCC368) through sub_82E10560 (main thread only, 2.6 % of process cycles inclusive), sub_82E100B0, sub_82E08FF8 (1.4 % + 1.2 %), sub_82DFC608 (1.4 % + 1.2 %) and sub_82DFC570 (1.1 % + 1.0 %), the parent of six of the specialised physics functions; the earlier native-region root sub_82DE3058 is under 0.3 %. sub_82DFC570 reaches 77 functions, runs about 46 times a frame and takes about 20 µs a call on the Odin.Established by | ProbableThe chain's order and shares are measured; that these are the car-physics step rests on the specialised physics functions below them (NN-5.1). |
sub_82D2F348sub_82D21DB0v4sub_82DF1478sub_82DE3D10sub_82E10560sub_82CCC368sub_82DCD8D0sub_82E04258sub_82DFB4A0 | no hot tyre model in a v4 race On the Odin at the 60 fps limit the physics-world step sub_82E10560 and the job workers sub_82CCC368 together are 5.2 % of process cycles, about 1.4 ms of CPU a frame, spread flat: the hottest leaf (sub_82DCD8D0) is 12.8 % of it, the next sub_82E04258 9.8 % and sub_82DFB4A0 7.4 %, and the top 20 leaves cover 76 %. The tyre model (sub_82DF1478, base sub_82D2F348) is 0.01 % of the process and sub_82DE3D10 (base sub_82D21DB0, the largest NN-5.1 specialisation) does not show. A native tyre model alone could save microseconds a frame, far under #1071's 0.5 ms gate; a gain from physics needs the whole car step (about 85 % of the world step is under sub_82E08FF8 > sub_82DFC608) written natively.Established by The Odin call graph cg1071a (0.8.2 v4 Release, | Confirmed Negative |
sub_825A6208sub_82450160sub_823ED888sub_823E40D8 | render and simulation call chains In race call graphs the render thread's time runs through sub_825A6208, then the render thread frame sub_8259F3E8, then sub_82450160; the simulation thread's runs through sub_823ED888, then sub_823E40D8. The roles of sub_82450160 and sub_823E40D8 are not known.Established by | Guess |
sub_82B8ED78sub_82D4E2E0 | no hot MLP matrix kernel The burst job typed over CMLPMatrix<float> (sub_82B8ED78, see "job worker threads") does no matrix work of note: 98 % of its time is under the physics-world step sub_82D4E2E0, in CCarDynamics functions and math helpers. CMLPMatrix and CMLPArray are generic container templates, instantiated for int, short, float and CPinnedCubicSegment, and the vtable slots of all 47 MLP and RacingAI classes together take 0.18 % of the process's own cycles. There is no matrix kernel there to vectorize or replace.Established by RTTI class names, template arguments and vtable slots from the RTTI records; Odin call-graph profiles ( | Probable Negative |