Repository navigation
Performance Research A08 Voice Sample Spans
| Field | Value |
|---|---|
| Evidence state | Source-confirmed repeated translation; span observation semantics pending |
| Inspected source | 322986f4c5502b3fa887a9605ac8cd88e9b2c579 |
| First experiment | One boundary-limited ordinary-RAM span |
| Scope | Addendum dated September 15, 2026; not a current-main benchmark or implementation status |
Unproven performance research · Performance research — common test protocol · Performance research — reproducible checks
Confirmed route. voice_get_samples() walks PCM samples through physical-memory helpers. Non-streaming PCM translates an SGE-backed address per sample, and non-streaming ADPCM fetches block words through repeated SGE translation and physical reads. The source explicitly raises cross-page handling as an issue. Fetch implementation.
Implementation. Build a span limited by the earliest of the mapped RAM boundary, SGE/page boundary, SSL segment end, loop/end cursor, ADPCM block, or required notification/state transition. Decode a span while retaining the same state/cursor updates. Ordinary RAM can take the fast path; MMIO or ambiguous mappings retain the helper route.
Correctness boundary. Reading a span early changes when guest memory is observed. Establish the ownership/synchronization interval; a successful map does not make the underlying contents immutable. Avoid assuming physical contiguity from virtual/SGE contiguity, or trusting a sample's first byte to prove the remaining bytes are mapped identically. QEMU's memory API distinguishes direct RAM access, region lifetime, and dirty/invalidation obligations. Memory API.
Expected gain. Fewer helper calls and repeated address translations; more benefit for many active voices, small PCM samples, or fragmented non-streaming paths than for already contiguous streaming ADPCM. Measure translations and bytes per span.
Acceptance. Include page-crossing stereo samples, loops, SSL transitions, pause, end-of-stream notifications, partial reads, resampler callback repetition, and guest updates at span boundaries.
Keep scalar/MMIO fallbacks. A mapped pointer does not freeze guest data; define when the batch observes writes before increasing span size.
sample cursor -> earliest mapping/SGE/SSL/loop/block boundary -> decode eligible span -> same cursor/notify updates
Locate the inspected seam before editing; names or ownership may have changed since the pinned review:
git grep -n -E 'voice_get_samples|get_data_ptr|adpcm' -- hw/xbox/mcpx/apu/vpThese are implementation gates to add or exercise, not claims that production tests already exist or passed. Retained standalone checks are on the checks page.
| Test ID | Setup / deliberate control | Required oracle |
|---|---|---|
A08.01 |
A stereo sample crosses a page/SGE boundary into a noncontiguous physical mapping. | Every byte comes from its correct mapping; the span splits before an invalid assumption. |
A08.02 |
PCM and ADPCM around loop end, SSL segment transition, end-of-stream and repeated resampler callbacks. | Decoded samples, cursor state and notification order match scalar behavior. |
A08.03 |
Change guest sample memory at a declared span boundary; use MMIO/ambiguous mapping as a fallback control. | The observation contract and fallback route are respected. |
Collect: sample_bytes, span_count, span_length_histogram, sge_translations, physical_reads, fallback_reasons, fetch_cpu_ns. Keep exact counts separate from sampled durations; use an uninstrumented build for performance qualification.
Reject or hold: Reject an output/cursor/notification difference or a change to guest-memory visibility. More bytes per span is not useful if it creates read-ahead work or stalls.
Follow the common protocol for source identities, previous-main/fixed-baseline controls, raw results, confidence and retail/XISO qualification. No gain becomes proven from a model, cache hit, local operation count, or shifted wait label alone.
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