Repository navigation
Assumption Based Shortcut Validation
Lifecycle indexes: Implemented · Researched · Unproven
Status: Source validation and experiment design; no candidate on this page is accepted merely by being listed.
Reviewed source:
322986f4c5502b3fa887a9605ac8cd88e9b2c579Reviewed: 2026-09-14
This page validates seven proposed real shortcuts against current xemu. Here, a shortcut means a narrow route that bypasses an operation performed by a maintained, more general route because an explicit assumption says that operation is unnecessary or an approximation is acceptable.
A shortcut must answer three questions:
- What disappears from the common path?
- What assumption permits that bypass?
- What happens when the assumption is false?
A cache, cleaner allocation strategy, prepared-state table, or more precise copy range is not automatically a shortcut. Those mechanisms belong in Performance Optimization Catalog.
| Proposal | Validation | Classification | Wiki disposition |
|---|---|---|---|
| Trust a shader-selection generation | Applicable, but overlaps an implemented shortcut | Stronger exact-assumption variant of Skip unchanged shader work
|
Dedicated research page plus cross-link to the current shortcut |
| Validate textures once per guest frame | Applicable only as an explicit approximation | Frame-scoped stale-content shortcut | Added as diagnostic/HOLD research |
| Replace sinc resampling with linear | Applicable as an audio-quality approximation | Cheaper alternate algorithm | Added as optional approximation research |
| Sample an existing surface directly | Applicable for a narrow admitted subset | Copy bypass / direct alias | Added as exact-subset research |
| Supply an approximate occlusion result | Applicable only as title-scoped approximation | Guest-result substitution | Added as high-risk research |
| Replace a recognized polling loop with an event wait | Conditionally applicable | Guest-execution bypass | Added as narrow vCPU research; generic loop recognition is rejected |
| Direct-RAM read windows | Architecturally possible, not yet an xemu-owned shortcut target | Region-level SoftMMU/TLB bypass | Documented as deferred; requires a measured translated-code region before implementation |
The reviewed main contains no user controls for the five new approximation/bypass candidates. Current tweak controls cover short waits, packet batching, fence reads, color-download folding, bounded uploads, transient-buffer growth, native S3TC, hybrid ubershaders, and unchanged shader work.
The candidate must preserve the declared guest-visible behavior. Its assumption is a cheaper proof that the general operation is unnecessary.
Examples:
- reuse a known-valid shader selection;
- sample the original surface when aliasing preserves the exact required image version;
- sleep through a proven side-effect-free polling loop, then retry the original loop.
Any unexplained output, ordering, interrupt, fault, or lifetime difference is a failure.
The candidate intentionally changes behavior and must say so before testing.
Examples:
- permit texture contents to remain stale until the next validation boundary;
- use non-bandlimited linear interpolation instead of sinc resampling;
- return optimistic visibility instead of an exact occlusion count.
Acceptance requires a measured performance benefit, an explicit error/quality budget, a compatibility scope, and a maintained exact route. Output equality is not the acceptance claim.
flowchart TD
A[Operation requested] --> B{Candidate opportunity reached?}
B -->|No| R[Run maintained general route]
B -->|Yes| C{Assumption and policy admit shortcut?}
C -->|No| R
C -->|Yes| D[Record opportunity and selected route]
D --> E[Bypass operation or substitute cheaper behavior]
E --> F[Publish declared guest-visible result]
R --> F
F --> G[Correctness or quality oracle]
G --> H[Whole-workload performance and tails]
A route counter proves only that the experiment was reached. It does not prove the assumption was valid or that the whole emulator improved.
Every candidate needs a test that deliberately violates its assumption:
| Candidate | Required negative control |
|---|---|
| Shader generation | Omit one required epoch increment and prove the differential oracle detects stale selection |
| Frame texture trust | Change texture bytes after first validation but before the trusted draw |
| Linear resampling | Use high-frequency and changing-pitch material that exposes non-bandlimited behavior |
| Direct surface sampling | Render red, sample it, overwrite blue, and verify the two consumers observe the correct versions |
| Approximate occlusion | Use a consumer that depends on exact count magnitude rather than nonzero visibility |
| Poll-loop wait | Add a side effect, timeout calculation, interrupt, or self-modifying code to the recognized loop |
| Direct-RAM window | Remap to MMIO, cross a page, revoke permission, add a watchpoint, or restore a snapshot |
A shortcut that succeeds only when its assumption is never challenged has not been qualified.
Correctness runs may use differential execution, expensive state comparisons, validation layers, detailed events, and fault injection. Performance runs must use the intended optimized Release build and bounded counters; verbose per-operation logging can alter the race, cache pressure, and thread timing being measured.
Use independently seeded state for reference and shortcut comparisons. Several current operations mutate validation state: texture checks test-and-clear dirty bits, and shader-state reconstruction clears program_data_dirty. Running reference and candidate sequentially against one live object can invalidate the experiment.
- Shader Selection Epoch Trust
- Frame-Scoped Texture Trust
- Linear Audio Resampling
- Direct Surface Sampling
- Approximate Occlusion Reports
- Recognized Guest Poll-Loop Wait
- Direct-RAM Read Windows
- Hot-Path Shortcuts
- Using Hot-Path Shortcuts
- Performance Optimization Catalog
- Debugging Lag & Hot-Path Analysis
- Pull Request Lessons
vCPU Shortcut Candidates adds five source-backed vCPU/JIT bypass experiments. Their assumptions concern host instruction semantics, helper effects, retained FP-control validity, and bounded ordinary-RAM spans. The two adjacent Win64 register/flag-capture ideas are documented separately as nonshortcut backend optimizations.
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