Skip to content

fix(illustration): make the road constrain where vehicles can be in the seed - #57

Merged
upgradedev merged 1 commit into
mainfrom
feat/seed-road-constrains-vehicles
Aug 3, 2026
Merged

fix(illustration): make the road constrain where vehicles can be in the seed#57
upgradedev merged 1 commit into
mainfrom
feat/seed-road-constrains-vehicles

Conversation

@upgradedev

Copy link
Copy Markdown
Owner

The sealed schematic and the AI clip disagreed, and in the clip a vehicle arrived from off the road entirely, driving over ground that is not a carriageway.

The measured cause

The clip is already seeded with our own deterministic schematic raster, but that raster is drawn in the blueprint palette, which is designed to be read by a person who already knows they are looking at a diagram. As an instruction to an image-to-video model it is close to useless:

value
Carriageway #16242e
Background #0e1a22
Contrast ratio 1.11:1 invisible
Survey grid #17303d brighter than the road

Rendered, the seed contains no road at all. It reads as one dark textured field with two bright shapes on it. A model handed that has no surface to keep vehicles on, and "off the carriageway" is not even expressible in the input. The frame the demo case was actually seeded with is the top image below.

What this does

Prompt-level geometry instructions were already tried and failed (handover 4b, attempt #25), so this does not ask the model for anything. It makes the road unmistakable in the seed, which is our own deterministic render and therefore fully under our control:

  • a dominant, high-contrast carriageway on a distinctly non-drivable verge (3.31:1, from 1.11:1)
  • a bright kerb line along every carriageway edge
  • white lane markings instead of a thin amber dash
  • no survey grid, which was the brightest structure in the frame and made it read as an abstract technical drawing
  • a dark outline on the vehicle nose wedge, so the "which way is this facing" cue is legible on a white or silver body instead of vanishing into it

The kerb is derived, not enumerated

Stroking each road rectangle would draw a wall straight across a T-junction's mouth, and hand-enumerating union boundaries for five layouts is exactly where this would go wrong. Instead the road primitives are rasterised into a mask, the roundabout island is punched out of it, the mask is eroded, and the difference is the carriageway's own outline. It never knows which layout it is looking at, so it cannot be geometrically wrong, and a new layout needs no new case. All five templates are in the test loop; the roundabout's island and the parking lot's single slab both come out right.

Sealed artifacts are untouched

Confined to the seed by a seed_style flag that defaults off. hero_png, every animation frame and the SVG keep the blueprint palette and their exact bytes, asserted directly rather than assumed:

assert art.hero_png == render_frame(tl, i, title="t", scale=8.0)
assert all(f == render_frame(tl, n, title="t", scale=8.0) for n, f in enumerate(art.frames_png))
assert art.static_svg == build_static_svg(tl, title="t", scale=8.0)

Geometry is untouched: colours and strokes only, so the world-to-pixel mapping is identical and camera.py's push, which is computed in that same mapping and passed seed_scale, stays correct with no change. seed_scale_for is deliberately not touched, so this measures one lever.

Tests

The new test measures the thing that was wrong rather than just asserting bytes moved: it samples the carriageway and the verge and asserts the contrast ratio, and asserts the old palette's ratio is under 1.5 at the same two points, so the regression this fixes cannot come back quietly. A second test asserts a bright kerb exists where the carriageway ends and that nothing like it exists in the old palette.

580 passed, coverage 97.57% against the 90% gate.

Live verification, and what it does and does not prove

Two live renders, pixverse-v6-i2v with the production parameters (same prompt, negative prompt, duration, quality, aspect ratio) and two different clip seeds so the second is an independent sample rather than a repeat.

In both clips, every vehicle stayed on the carriageway for the whole clip. The road structure was preserved exactly: kerbs, verge, T-junction, centre lines, the stop sign sitting in the verge beside the road. Direction agreed with the schematic in both.

Two samples of an intermittent failure is evidence, not proof, and it is worth saying so: the handover documents this failure appearing in some renders and not others across ten.

Not fixed, and still visible: the separate known defect where the model paints an extra vehicle. Both clips keep the flat seed glyph and render a photorealistic car beside it, so two white bodies appear where the scene declares one. Worth noting that both are in the correct lane travelling the correct direction, which is a milder failure than the third-vehicle-at-an-impossible-angle renders documented earlier, but it is not fixed and this PR does not claim it is.

…he seed

The illustration clip is seeded with our own deterministic schematic
raster, but the seed was drawn in the blueprint palette, which is built to
be read by a person who already knows they are looking at a diagram. As an
instruction to an image-to-video model it is close to useless, and this is
measured rather than guessed: the carriageway (#16242e) against the
background (#0e1a22) is a 1.11:1 luminance contrast ratio, and the survey
grid is BRIGHTER than the road. Rendered, the seed contains no visible road
at all. It reads as one dark textured field with two bright shapes on it,
so a model handed it has no surface to keep vehicles on, and live renders
duly produced a vehicle arriving over ground that is not a carriageway.

Asking the model in words to stay on the road was already tried and failed
(handover 4b, attempt #25), so this does not ask. It makes the road
unmistakable in the seed, which is our own deterministic render and
therefore fully under our control: a dominant high-contrast carriageway on
a distinctly non-drivable verge, a bright kerb line, white lane markings,
no survey grid, and a vehicle outline legible against every body colour.

The kerb is derived from the drivable surface rather than enumerated per
layout: the road primitives are rasterised into a mask, eroded, and the
difference is the carriageway's own outline. That cannot be geometrically
wrong for any layout, so it wraps a T-junction's corners without drawing a
wall across its mouth, and the roundabout's central island is punched out
of the surface rather than special-cased. All five layout templates are
covered by the test loop.

Confined to the seed by a seed_style flag that defaults off. Every
sealed artifact -- hero_png, the animation frames, the SVG -- keeps the
blueprint palette and its exact bytes, asserted directly. Geometry is
untouched: this changes colours and strokes only, so the world-to-pixel
mapping, and therefore camera.py's push computed in that same mapping, is
exactly as it was.

Verified on two live renders (pixverse-v6-i2v, production parameters,
different clip seeds). In both, every vehicle stayed on the carriageway
across the whole clip and the road structure was preserved. Two samples of
an intermittent failure is evidence, not proof. The separate known defect
where the model paints an extra vehicle is NOT fixed by this and still
shows: both clips keep the flat seed glyph and add a rendered car beside
it, though on the correct lane travelling the correct direction.
@upgradedev

Copy link
Copy Markdown
Owner Author

Closing unmerged, by the owner's decision and not on the merits.

Both submissions are now SUBMITTED on Devpost with their YouTube links, and the owner may be unavailable through the deadline. Merging here fires an automatic Cloud Run deploy of the exact URL judges will open, and the illustration geometry is a known limitation the architecture already contains and discloses. Not worth risking a submitted product for while nobody is watching.

The branch feat/seed-road-constrains-vehicles is left on the remote on purpose. It is complete, tested and live-verified; anyone picking this up after the deadline should start from it rather than rediscovering the cause. The commit message and the PR description above carry the full finding.

The short version for whoever is next:

  • The measured cause is seed contrast, not model stubbornness. The seed's carriageway (#16242e) against its background (#0e1a22) is a 1.11:1 luminance contrast ratio, and the survey grid (#17303d) is brighter than the road. Rendered, the seed contains no visible road at all. "Off the carriageway" was not expressible in the input we were handing the model, which is why prompting could never have fixed it.
  • The fix is a seed-only palette: dominant high-contrast carriageway on a non-drivable verge (3.31:1), a bright kerb, white lane markings, no grid. Sealed artifacts keep the blueprint palette and their exact bytes, asserted directly.
  • Derive the kerb, do not enumerate it. Rasterise the road primitives into a mask, punch out the roundabout island, erode, and take the difference. That is the carriageway's own outline, it cannot be geometrically wrong for any layout, and it wraps a T-junction's corners without drawing a wall across the mouth. Enumerating union boundaries per layout is the trap.
  • Two live renders (pixverse-v6-i2v, production parameters, two different clip seeds): every vehicle stayed on the carriageway for the whole clip in both, and the road structure was preserved exactly. Two samples of an intermittent failure is evidence, not proof.
  • Not fixed: the model still paints an extra vehicle. Both clips keep the flat seed glyph and render a photorealistic car beside it. Both were in the correct lane travelling the correct direction, which is milder than the earlier impossible-angle renders, but it is a separate defect and this change does not touch it.

@upgradedev upgradedev closed this Aug 3, 2026
@upgradedev upgradedev reopened this Aug 3, 2026
@upgradedev
upgradedev merged commit 5948b9b into main Aug 3, 2026
21 checks passed
@upgradedev
upgradedev deleted the feat/seed-road-constrains-vehicles branch August 3, 2026 19:35
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