Skip to content

blitter: a blit with no channels enabled asserts no BLTPRI CPU fence#170

Merged
LinuxJedi merged 1 commit into
mainfrom
fix/bltpri-null-blit-fence
Jul 12, 2026
Merged

blitter: a blit with no channels enabled asserts no BLTPRI CPU fence#170
LinuxJedi merged 1 commit into
mainfrom
fix/bltpri-null-blit-fence

Conversation

@LinuxJedi

Copy link
Copy Markdown
Owner

Found by the pre-0.11 full vAmigaTS sweep (2998 cases vs fresh vAmiga references, compared against the 0.10 release-morning baseline).

Problem

Agnus/Blitter/bltint1 and bltint5 collapsed from ~8-10% to 95.5% divergence: Copperline rendered a near-solid blue frame where vAmiga (and the real A500 photo in the test folder) show the interrupt-choreographed stripe pattern. Bisect: first bad at #162 (the BLTPRI BLS fence), not repaired by #166's warm-up narrowing.

These tests restart a null blit (BLTSIZE with all BLTCON0 USE bits clear, 1x1) from the blitter interrupt handler every scanline under BLTPRI. The warm-up fence charged every BLTPRI blit ~4 cck of CPU denial during the startup ladder -- but a blit with no channels never asserts a bus request at all, and BLS follows the request line. The accumulated denial across the per-line null-blit chain wedged the tests' COLOR00 choreography.

Fix

bltpri_warmup_fences_cpu returns false when no channel is enabled. Channel-carrying blits keep the full warm-up fence (the Jim Power trackloader guarantee is untouched).

Verification

  • Full Agnus/Blitter suite re-run against the sweep's vAmiga references: bltint1 95.5 -> 3.9, bltint5 95.5 -> 7.4 (both better than the 0.10 baseline of 8.5/10.2); the null-blit cputim/invisible0 case improves 21.8 -> 1.5, bususage0 6.4 -> 3.2, race0 3.0 -> 0.02; no other case moves.
  • Save-state oracles unchanged: Jim Power in-game (byte-identical screenshot), Rampage "present" cadence, dot-cube smoothness.
  • Full cargo test --release green; all 18 golden probes byte-identical; CI-exact clippy and fmt clean.

Sweep summary for context (0.10 baseline -> 0.11): mean divergence 9.06% -> 7.04%, cases over 5% divergence 1148 -> 771, 1400 cases improved vs ~200 mildly moved. The remaining notable movers (cputim2/4) are a separate story: the real-hardware photos show vAmiga does not match real hardware there either (its bars miss the red/yellow colouring that Copperline reproduces), so they are not treated as reference regressions.

BLS follows the blitter's bus request line, and a null blit (BLTSIZE
with all BLTCON0 USE bits clear) never requests the bus at all -- so
with BLTPRI set it must not fence the CPU during its startup ladder
either. The warm-up fence charged every BLTPRI blit ~4 colour clocks of
CPU denial, which broke interrupt-driven null-blit chains: vAmigaTS
Agnus/Blitter/bltint1/5 restart a USE=0 1x1 blit from the blitter
interrupt every scanline, and the accumulated denial wedged the test's
COLOR00 choreography into a near-solid frame (8.5% -> 95.5% divergence
against the vAmiga reference in the pre-0.11 sweep).

With the exemption the full Agnus/Blitter suite reads: bltint1
95.5 -> 3.9 and bltint5 95.5 -> 7.4 (both better than the 0.10-era
baseline), the null-blit cputim/invisible0 case 21.8 -> 1.5, and
bususage0/race0 improve; no other case moves. Jim Power (channel blits
keep the warm-up fence), Rampage, and the dot-cube save-state oracles
are unchanged, and all 18 golden probes are byte-identical.
@LinuxJedi LinuxJedi merged commit e13461a into main Jul 12, 2026
7 checks passed
@LinuxJedi LinuxJedi deleted the fix/bltpri-null-blit-fence branch July 12, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant