Skip to content

Port the oil-vs-uranium paint-order check to Rust (#227) - #355

Merged
wormeyman merged 1 commit into
mainfrom
feat/227-oil-paint-order
Aug 30, 2026
Merged

Port the oil-vs-uranium paint-order check to Rust (#227)#355
wormeyman merged 1 commit into
mainfrom
feat/227-oil-paint-order

Conversation

@wormeyman

Copy link
Copy Markdown
Collaborator

Port-first entry 4. The mechanism is already here - oil_mark and
oil_outranks in paint_nauvis_resources, plus compare_priority in
resolve_resource.rs - but nothing graded it at render time. So the exception
shipped ungraded, and an inverted comparison would have gone green.

Crude oil's 3x3 marks are painted in pass 1 and the thresholded resources over
the top in pass 2. That is right for the four solids, whose autoplace order "b"
beats oil's "c", and wrong for uranium, which is also "c" but sorts after oil.
Issue #22 recorded the inversion as latent on a single measurement - over
[-2048,-2048]-[2048,2048] at seed 123456 the oil and uranium footprints share
0 tiles - and that turned out to be a property of that seed rather than of the
geometry. A 1024-window sweep over 1.7e10 tiles found 7 wells overwritten by
uranium, 5 of them on all nine mark pixels.

Four cases, ported from test/renderResourcesPaintOrder.spec.ts, at two control
settings that differ by three orders of magnitude in how often this happens.

Planted rather than predicted, and the two plants are what show the four cases
are jointly necessary - no single wrong implementation passes them all:

plant fails
drop the oil_outranks guard (the pre-guard renderer) the two oil-under-uranium cases; iron and the control unaffected
let a painted oil mark beat everything the iron case alone

That first row reproduces exactly what the original spec recorded when it was
run against the pre-guard renderer, which is the check that this port carries
the same discrimination rather than merely the same expectations.

The probe builds the request at the ABI rather than calling the painter, so it
grades the shipped path: a 3x3 window at one tile per pixel, centred on the
well, with placement_sweep_box grown by the mark radius the way the app's own
writer grows it. A box that covered only the window would drop the halo this
test is about.

Claude-Session: https://claude.ai/code/session_01UVcbv1pAhPUoCC6aBwZUtg

Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com

Port-first entry 4. The mechanism is already here - `oil_mark` and
`oil_outranks` in `paint_nauvis_resources`, plus `compare_priority` in
`resolve_resource.rs` - but nothing graded it at render time. So the exception
shipped ungraded, and an inverted comparison would have gone green.

Crude oil's 3x3 marks are painted in pass 1 and the thresholded resources over
the top in pass 2. That is right for the four solids, whose autoplace order "b"
beats oil's "c", and wrong for uranium, which is also "c" but sorts after oil.
Issue #22 recorded the inversion as latent on a single measurement - over
`[-2048,-2048]-[2048,2048]` at seed 123456 the oil and uranium footprints share
0 tiles - and that turned out to be a property of that seed rather than of the
geometry. A 1024-window sweep over 1.7e10 tiles found 7 wells overwritten by
uranium, 5 of them on all nine mark pixels.

Four cases, ported from `test/renderResourcesPaintOrder.spec.ts`, at two control
settings that differ by three orders of magnitude in how often this happens.

Planted rather than predicted, and the two plants are what show the four cases
are jointly necessary - no single wrong implementation passes them all:

| plant | fails |
| --- | --- |
| drop the `oil_outranks` guard (the pre-guard renderer) | the two oil-under-uranium cases; iron and the control unaffected |
| let a painted oil mark beat everything | the iron case alone |

That first row reproduces exactly what the original spec recorded when it was
run against the pre-guard renderer, which is the check that this port carries
the same discrimination rather than merely the same expectations.

The probe builds the request at the ABI rather than calling the painter, so it
grades the shipped path: a 3x3 window at one tile per pixel, centred on the
well, with `placement_sweep_box` grown by the mark radius the way the app's own
writer grows it. A box that covered only the window would drop the halo this
test is about.

Claude-Session: https://claude.ai/code/session_01UVcbv1pAhPUoCC6aBwZUtg

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wormeyman
wormeyman force-pushed the feat/227-oil-paint-order branch from a997685 to c2ef388 Compare August 30, 2026 05:43
@wormeyman
wormeyman merged commit 7732a69 into main Aug 30, 2026
9 checks passed
@wormeyman
wormeyman deleted the feat/227-oil-paint-order branch August 30, 2026 06:05
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