Repository navigation
Hot Path Shortcuts
Reviewed: 2026-11-01 · Source: b7140848 · Availability: current main; stable/main boundaries are stated below.
Current implementation/defaults and stable/main availability are maintained in Current status, Current register and Controls. Dated observations below retain their own source and evidence boundary. Current Avoid ordered vertex copies is delivered by#89: unread-page direct writes and bounded immutable private versions preserve ordered fallback; live Vulkan permission defaults On. Vertex lifetime.
Lifecycle indexes: Implemented · Researched · Unproven
Scope: Guarded bypasses and special-case fast routes only.
For the broader performance catalog—including caches, prepared work, structural optimizations, resource policies and alternate execution—see Performance Optimization Catalog.
A hot-path shortcut is not simply code that is faster.
It is a route that avoids work performed by a more general, maintained implementation because a narrow condition, capability, constant or state proof says that work is unnecessary for this operation.
flowchart TD
A[Operation enters hot path] --> B[Evaluate narrow guard or assumption]
B -->|Not proven| R[General correct route]
B -->|Proven| S[Skip, fold, reuse or substitute work]
S --> V[Validate required result/order]
R --> V
V --> Z[Guest-visible outcome]
The general route is important. It is both:
- the correctness fallback when the shortcut is ineligible; and
- the controlled reference path used to prove whether the shortcut still matters.
A mechanism belongs on this page when most of the following are true:
- it has a slower/general route that is already correct;
- it explicitly skips, folds, reuses, substitutes or returns before that route completes;
- a cheap guard or special case selects the shortened route;
- a stale or incomplete guard can cause wrong output, wrong ordering, missed invalidation or unsafe lifetime;
- the reference route can be forced without disabling unrelated correctness behavior.
A magic number or hard-coded threshold may be part of a shortcut, but is not required. Conversely, using a magic number does not make an allocation policy a shortcut.
The following are performance work, but they are classified elsewhere:
| Mechanism | Correct classification | Example |
|---|---|---|
| Better allocation and lifetime management | Resource-management policy | Transient-Buffer Growth |
| Copy only required data | Structural optimization | Bounded Vertex Uploads |
| Reuse an exact keyed result | Cache/prepared work | Shader Caching |
| Move fixed computation to initialization/build | Precomputation | Audio Attenuation Lookup |
| Maintain an index instead of rescanning | Prepared metadata | Surface Coverage Index |
| Use another complete semantic implementation | Alternate execution/fallback | Hybrid Ubershader |
A switch in Advanced settings does not change any of those classifications. The switch exists for isolation and regression recovery.
| Shortcut | General route | Bypassed work | Guard / special case | Primary failure if wrong |
|---|---|---|---|---|
| Bulk Packet Processing | Scalar per-word method dispatch | Repeated packet dispatch/bookkeeping | Supported packet form plus whole-packet preflight | Partial mutation, wrong method order or malformed-packet handling |
| Fast Fence Polling | Locked PGRAPH MMIO read |
pgraph.lock acquisition for every poll |
Exact fence register and exact 32-bit access | Stale/unordered fence publication |
| Shortcut | General route | Bypassed work | Guard / special case | Primary failure if wrong |
|---|---|---|---|---|
| Skip Unchanged Shader Work | Full shader/pipeline route evaluation | Repeated route/key/pipeline preparation | No relevant register/program/non-register/selection change; complete executable remains valid | Wrong shader or pipeline stays bound |
| Color-Download Folding | Separate download submission and wait | Extra command-buffer boundary and wait | Eligible color download already ordered after its producer | CPU sees incomplete or wrongly ordered surface data |
| Clean Texture Stages | Normal per-stage create/update/bind work | Reprocessing a clean stage after another stage caused slow binding | Binding/source/dirty/overlap/DMA-address checks | Stale texture, palette or surface source |
| Unchanged Scanout | Fresh render_display() conversion/submission |
Complete display conversion and submission | Full completed-output key plus lifetime and upload guards | Stale or incomplete presented image |
| Shortcut | General route | Bypassed work | Guard / special case | Primary failure if wrong |
|---|---|---|---|---|
| Windows Short Waits | Busy-spin short-wait compatibility route | Active CPU spinning | Windows, eligible timeout range, policy, timer creation/arm state | Missed event readiness or worse wake tails |
| Windows QPC Conversion | Generic muldiv64()
|
General multiply/divide conversion | Startup frequency divides one second exactly | Incorrect or non-monotonic host time |
| Native S3TC Upload | CPU decode followed by uncompressed upload | CPU decompression and expanded upload | Compatible format/layout/extension path | Wrong compressed layout or sampling output |
| Candidate | Proposed bypass | Assumption class | Status |
|---|---|---|---|
| PFIFO Constant Status Read | Return one modeled constant before acquiring the PFIFO mutex | Current-model constant plus exact register/size | Measure first; not implemented |
Mono Voice Resampling may eventually become a guarded specialization, but it is currently classified as alternate specialized execution. Until channel transitions, persistent resampler state and snapshot semantics are proven, it should not be documented as a qualified shortcut.
Every bypass condition is explicit, the reference route remains reachable, and focused tests cover both routes.
The shortcut is valid only when a host API feature or format contract is present. Native S3TC upload belongs here.
A measured threshold or tuning constant selects the route, but failure and unsupported cases return to a maintained path. Windows short waits belong here because the sub-1.25 ms range is a policy threshold, not an Xbox semantic constant.
The shortcut preserves what xemu currently models, but the assumption may not represent all physical-hardware behavior. The proposed PFIFO constant-status return belongs here.
The shortened route exists before its guard, invalidation, ordering or lifetime proof is complete. Such a path must remain diagnostic and must not silently become the default.
A shortcut can fail even when its local result appears faster.
A dependency changes but the route still reports eligible.
A “check” may clear dirty state, consume an event or publish a lifetime transition. Re-running it for telemetry can change behavior.
The fallback compiles but no longer produces the same result, making A/B evidence meaningless.
A local finish, compile, copy or validation disappears from one helper but reappears at another boundary.
A shortcut based on “this should almost never happen” can fail badly when another title, driver or host configuration reaches the case frequently.
A constant selected on one machine can improve mean CPU while worsening p99 wake or frame latency elsewhere.
Every shortcut page must state:
Bypassed work
Maintained reference route
Eligibility guard or assumption
Whether any guard has side effects
Fallback when the optimized path fails
State/lifetime invalidation
Counters proving both routes were reached
Failure if the assumption is wrong
Whether constants are semantic, capability-derived or heuristic
Use Using Hot-Path Shortcuts when the experiment is specifically an optimized bypass versus its maintained reference route.
Use Using Performance Controls for broader settings behavior, persistent caches, restart-latched resource policies and alternate execution strategies.
flowchart LR
A[Profile real symptom] --> B[Identify exact bypass and reference route]
B --> C[Prove both routes reachable in one Release binary]
C --> D[Run balanced fixed-work comparison]
D --> E{Correctness/order/lifetime equal?}
E -->|No| F[Shortcut failed; investigate]
E -->|Yes| G[Compare local avoided work and end-to-end tails/resources]
- Performance Optimization Catalog
- Using Hot-Path Shortcuts
- Using Performance Controls
- Debugging Lag & Hot Paths
- Performance Methodology
- Pull Request Lessons
Assumption-Based Shortcut Validation reviews seven proposed bypasses against exact current source. It separates exact shortcuts, explicit approximations, overlap with existing routes, and one deferred TCG-wide concept.
New research pages cover shader-selection generation trust, frame-scoped texture trust, linear audio resampling, direct surface sampling, approximate occlusion reports, recognized guest poll-loop waits, and direct-RAM read windows.
The source-validated vCPU Shortcut Candidates catalog separates genuine bypasses from ordinary backend improvements.
True shortcut investigations:
- Native Reciprocal Estimates — bypass lane-wise helper math with host estimate instructions; numerical/fidelity differences are explicit.
- Helper-Aware x87 Cache Retention — bypass canonical x87 flushes for explicitly audited FP-independent helpers.
- Native SSE Arithmetic — bypass floating-point helpers for a narrowly admitted host-SSE subset.
-
FP Control-State Retention — bypass redundant control decode and
LDMXCSRwhen the active host policy is still valid. - REP MOVS RAM Chunks — bypass repeated per-element memory work for a bounded admitted RAM span.
The Windows XMM-register budget and x87 flag-capture work are intentionally kept out of this list because they are backend optimizations, not assumption-based bypasses.
DSP tooling guide and navigation updated November 2, 2026 for experimental PR #384, source 8f51d237. Capture/replay usage and limits.
The earlier wiki-wide review was published November 1, 2026. Emulator source: b7140848. Reviewed wiki content: 1d2b671. Current status · Release availability · Publication process.
- Home
- Current status
- Stable versus main
- Implemented mechanisms
- Controls and defaults
- Measured results and limits
- Complete change register
- System
- CPU and vCPU
- Memory and DMA
- Graphics / NV2A
- APU and audio
- Timing and timers
- Platform and I/O
- Hardware observations
- Fidelity boundaries
- Methodology
- PGR2 routes
- Debugging lag / hot paths
- Tools and commands
- DSP capture, replay and fuzzing
- HLE readiness and public XISO proof
- Concurrent DSP shadow and OpenAL proof
- DSP HLE operation inventory
- DSP HLE fix examples and testing
- Development
- Upstream shortlist
- Wiki maintenance
- Research / retired work
- Optimization catalog
- Hot-path shortcuts
- Researched experiments
- Unproven proposal directory
- PR lessons
- September26 snapshot
Repository · PRs · Issues