Repository navigation
Using Hot Path Shortcuts
Lifecycle indexes: Implemented · Researched · Unproven
Scope: Testing a guarded bypass against its maintained general/reference route.
For saved settings, requested/effective state, CLI overrides, persistent caches, restart-latched policies and general evidence campaigns, see Using Performance Controls.
This page applies only when the mechanism is classified as a shortcut in Hot-Path Shortcuts.
The central question is:
Does skipping this specific piece of general-path work change correctness, ordering, guest progress, frame tails or resource use when both routes run in the same Release executable?
Do not begin with a setting label such as “Vulkan fast path.” State the operation that is omitted.
Good examples:
Exact 32-bit fence read bypasses pgraph.lock.
Eligible color download bypasses a separate submit/wait boundary.
Clean texture stage bypasses normal per-stage bind/update work.
Full scanout key hit bypasses render_display().
Exact QPC scale bypasses muldiv64().
A valid experiment must identify:
Entry point
General/reference route
Optimized bypass route
Eligibility guard
Fallback
Failure if guard is wrong
The Off/Disabled side is not useful merely because a UI checkbox changed.
It must execute the maintained route that the shortcut bypasses.
flowchart TD
A[Same operation and same binary] --> B{Shortcut policy}
B -->|Reference| R[General route counter increments]
B -->|Optimized| O[Bypass counter increments]
R --> V[Same correctness/order oracle]
O --> V
Reject the campaign when:
- the optimized side never attempts the shortcut;
- the reference side never enters the general route;
- the route is unavailable on the selected backend/platform;
- a restart-pending value means the requested mode is not active;
- another setting changes the same dependency chain.
A shortcut is not “enabled” simply because policy permits it.
policy permits shortcut
+ operation reaches shortcut site
+ every mandatory guard passes
= optimized route actually taken
Required counter classes:
attempts
eligible
optimized route
forced reference route
blocked by reason
fallback after optimized-route failure
For a fixed policy window, an accounting identity should normally exist, for example:
eligible = optimized + forced_reference
The exact identity must match the implementation. Do not invent a universal equation when fallback or retry paths overlap.
A shortcut control may select the final policy gate. It must not disable the guard that proves the shortcut safe.
flowchart TD
A[Operation state] --> G[Mandatory correctness/capability/lifetime guards]
G -->|Fail| R[General route]
G -->|Pass| P[Policy gate]
P -->|Permit| O[Shortcut]
P -->|Force reference| R
The following are not valid performance switches:
- dirty-memory publication;
- DMA/source-address revalidation;
- surface overlap and required readback;
- object lifetime generations;
- complete vertex-fetch bounds;
- original event-handle readiness;
- timer failure fallback;
- query/report ordering;
- exact QPC divisibility;
- capability and format support checks.
If the experiment must disable one of those, it is a correctness research branch, not a normal shortcut comparison.
Some checks mutate state while deciding eligibility.
Examples include:
- test-and-clear dirty-memory operations;
- consuming or resetting event state;
- retiring retry state;
- invalidating a retained-output key;
- publishing a completed resource generation.
Do not call a side-effectful guard twice—once for the route and once for telemetry. Capture its result once, then use that result for both the decision and counters.
A shortcut may use constants, but the constant must be labeled correctly.
| Constant class | Example | Test requirement |
|---|---|---|
| Semantic | Exact register width or format block size | Specification/source proof |
| Capability-derived | Host format feature or QPC divisibility | Startup/device proof |
| Heuristic | 1.25 ms short-wait threshold | Sensitivity sweep across hosts/workloads |
| Current-model assumption | PFIFO status modeled as constant | Preserve current behavior and state limitation explicitly |
| Capacity/resource tuning | 8 MiB initial buffer | Resource sweep; does not make mechanism a shortcut |
A hard-coded value without a classification is a documentation defect.
Use for stale output, wrong shader, missed wake, crash or ordering failures.
same binary
same input/snapshot
reference route reproduces or avoids symptom
shortcut route does the opposite
route counters prove both paths
oracle identifies exact difference
Use when route state does not contaminate later processes.
A1 reference
B1 shortcut
B2 shortcut
A2 reference
Then reverse order:
B3 shortcut
A3 reference
A4 reference
B4 shortcut
Keep fixed:
- executable SHA-256;
- source commit;
- Release build profile;
- matching workload/snapshot/input;
- renderer and selected GPU/driver;
- fixed guest-progress window;
- unrelated performance controls.
Use when policy changes can leave shortcut-owned state behind.
optimized route active
-> change policy
-> generation/invalidation observed
-> next operation forced through fresh/reference work
-> no pre-change cached object crosses boundary incorrectly
Do not start with frame percentages.
- Binary identity — same executable and source?
- Effective policy — did requested mode become active?
- Availability — was the route supported?
- Reachability — did the shortcut site execute?
- Eligibility — did guards pass often enough to test it?
- Reference proof — did the comparison side run the general route?
- Fallbacks — did the optimized route silently fail back?
- Correctness/order/lifetime — equivalent?
- Local avoided work — did the intended operation fall?
- End-to-end effect — guest progress, p50/p95/p99/max, CPU/GPU/resources?
| Result | Meaning |
|---|---|
| Attempts = 0 | Workload did not reach the shortcut |
| Attempts > 0, eligible = 0 | Guards rejected every attempt; inspect block reasons |
| Eligible > 0, optimized = 0 | Policy publication/gate/counter defect |
| Reference = 0 in reference mode | Comparison did not force the general route |
| Local work falls, frame time unchanged | Bypassed work is not end-to-end limiting |
| Average improves, p99 worsens | Shortcut changes tails or contention; not a simple pass |
| More guest work and more host CPU | Efficiency requires fixed-work normalization |
| Fallbacks high | Optimized mechanism is unreliable or workload is outside its intended domain |
| Output differs | Stop performance interpretation; shortcut failed correctness |
Prove exact address/width selection, publication ordering, reset/load behavior and unsupported-access fallback.
Prove complete dependency keys, invalidation, object lifetime, completion state and fresh work after policy transitions.
Prove producer order, barriers, capacity-growth recomputation and CPU visibility at the same caller-visible completion point.
Prove host support, effective representation, all unsupported-layout fallbacks and equivalent output.
Prove equality over the complete admitted input domain, monotonicity/overflow properties and no extra hot-path policy lookup.
Sweep the threshold. Report CPU and latency tails separately. A threshold that wins on one host is not automatically a product constant.
[ ] Mechanism is actually a shortcut, not merely another optimization class
[ ] General/reference route identified
[ ] Exact bypassed work identified
[ ] Guard and fallback documented
[ ] Constant/threshold classified
[ ] Same Release executable used
[ ] Optimized attempts > 0
[ ] Eligible count > 0
[ ] Optimized route count > 0
[ ] Reference route count > 0
[ ] Block and fallback reasons understood
[ ] Correctness oracle matches
[ ] Ordering and lifetime checks pass
[ ] Local avoided work measured
[ ] Fixed-work guest progress measured
[ ] p50/p95/p99/max reviewed
[ ] CPU/GPU/RAM/VRAM reviewed where relevant
[ ] Reference route remains maintained and tested
shortcut
= maintained correct route
+ narrow proof
+ explicit bypass
+ safe fallback
+ evidence that both routes executed
A resource policy, cache, prepared plan or cleaner algorithm can be an excellent optimization without being a shortcut.
- Performance Optimization Catalog
- Hot-Path Shortcuts
- Using Performance Controls
- Performance Methodology
- Debugging Tools & Commands
A shortcut campaign must declare its acceptance class before measurement. Equivalent shortcuts require independently seeded reference/candidate state and no unexplained output, ordering, interrupt, fault or lifetime difference. Approximate shortcuts require an explicit error or quality budget, compatibility scope, recovery behavior, and a maintained exact route; output equality is not their claim. See Assumption-Based Shortcut Validation.
For vCPU Shortcut Candidates, record both the selected route and the emitted/executed host work. A same-binary A/B is invalid when the candidate was selected but the relevant guest instruction or helper boundary was never reached.
Approximate routes—especially native reciprocal estimates—must report numerical divergence separately from performance. Exact routes must include a negative control that deliberately violates the admission assumption and proves that the reference/fallback path still protects the guest state.
Merged PR #123 is a direct shortcut-design lesson.
Disabling Process vertex packets in bulk exposed a path where oversized array packets could bypass dispatcher-level complete-packet capacity validation and reach scalar handlers. The preflight belonged to the operation, not to the optimized bulk route.
flowchart TD
A[Incoming packet] --> B[Validate complete packet / capacity / atomicity]
B -->|Invalid| C[Reject consistently]
B -->|Valid| D{Shortcut policy}
D -->|Bulk| E[Bulk handler]
D -->|Reference| F[Scalar/trace handler]
A maintained reference route is not merely “the old code.” It must preserve every correctness invariant used by the optimized route.
Qualification should cover invalid/oversized input with optimized, forced-reference, and tracing routes and compare exact rejection/consumption behavior.
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