Port the oil-vs-uranium paint-order check to Rust (#227) - #355
Merged
Conversation
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
force-pushed
the
feat/227-oil-paint-order
branch
from
August 30, 2026 05:43
a997685 to
c2ef388
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port-first entry 4. The mechanism is already here -
oil_markandoil_outranksinpaint_nauvis_resources, pluscompare_priorityinresolve_resource.rs- but nothing graded it at render time. So the exceptionshipped 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 share0 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 controlsettings 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:
oil_outranksguard (the pre-guard renderer)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_boxgrown by the mark radius the way the app's ownwriter 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