DEV Community

Nivando Soares
Nivando Soares

Posted on

A measured scanline contract finally beat static composition on a late Test Drive II frame

A measured scanline contract finally beat static composition on a late Test Drive II frame

I closed a small but important runtime checkpoint on the SNES-mimetic The Duel: Test Drive II port.

The question was narrow:

For the late gameplay family around frames 3250/3400/3550, should I keep extending the static BG3 top-band composition rule, or go back to stronger measured scanline/state fields?

Today the answer stopped being speculative.

The bounded experiment

I captured one new visible-scanline trace for the promoted late-entry traffic-emergence frame 3400 and wired it into the runtime's versioned scanline-contract surface.

The route was the existing bounded braking variant, so this was not a new archaeology lane, just a tighter test on the current port path.

The key artifact is:

  • tools/out/lane3_live_entry_brake_frame03400_scanline_full/td2_scanline_step_test.json

And the runtime output promoted from it is:

  • tools/out/port_gameplay_scanline_runtime_pngs_20260401/live_entry_3400_00000.png

What changed

Before this checkpoint, frame 3400 only used the static late-gameplay composition rule:

  • enable BG3 only in the top band
  • keep BG3 > BG2 only in that same band
  • cutoff 79

That rule was useful, but it still treated the whole late-entry family as basically “composition-only unless proven otherwise”.

The new scanline-backed 3400 render proved otherwise.

Compared to the earlier composition-only runtime PNG for the same frame:

  • pixel delta between the two runtime outputs: 9309
  • mismatch against bg_stack_visible_support.png: 15497 -> 7649

That is not a cosmetic shuffle. It is the first late-entry proof that the current measured scanline field family actually pays off on a promoted gameplay bundle.

Why this matters

This changes the next step for the port.

The late-entry gameplay family should no longer be treated as one uniform “static composition first” lane:

  • 3400 is now a positive proof that measured scanline fields can materially improve the runtime output
  • 3250 stays useful as the counterexample where the current main_layers/bg1/bg2/bg3 field set is still a no-op
  • 3550 is now the obvious next bounded follow-up

So the plan is no longer “extend static composition everywhere and maybe revisit scanlines later”.

The better plan is:

  1. keep the composition rule where it still earns its keep,
  2. but promote stronger measured scanline/state consumers where the evidence is already paying off,
  3. starting from 3400 and likely testing 3550 next.

Port-facing checkpoint

The runtime smoke now validates 3400 as a real scanline-backed consumer instead of a composition-only one.

That gives the SDL port a more honest picture of late gameplay: some of these frames need more than a static horizon-strip rule, and the runtime now has one concrete proof point inside that family.

Top comments (0)