fix(anatomy): V1-2.2 model arcs as browsers store them
Second security review: endpoints equal in f32 draw no arc, as in browsers; an arc carries the spread of its f32 variants (endpoint or radius moved one ulp) in its deviation and their extremes in its bounds. Probe and mutants extended.
This commit is contained in:
1 parent
03be75beed
commit
86dce16b09
5 files changed
+141
-19
No files matched your search
@@ -4382,12 +4382,12 @@ validated equine; below, a tap target smaller than the points'.
|
||||
| `path` unit tests | 300 random cubics, quadratics and arcs: every curve point within the recorded deviation of its chords, the deviation within 0.05 unless capped (arcs whose radii the endpoints scale up); closepath restarts at the subpath start; vertex cap |
|
||||
|
||||
Browsers (`apps/app/e2e/ui/interior-clicks.spec.ts`, the six click projects: Chromium 1280, 375 and 320 touch, Firefox
|
||||
1280, WebKit 1280 and 375 touch; 96 passed, and `canvas-clicks.spec.ts` 99 unchanged). The probe
|
||||
(`e2e/fixtures/interior-probe.json`, written and drift-checked by `tests/interior_probe.rs`) gives 15 shapes in the
|
||||
1280, WebKit 1280 and 375 touch; 102 passed, and `canvas-clicks.spec.ts` 99 unchanged). The probe
|
||||
(`e2e/fixtures/interior-probe.json`, written and drift-checked by `tests/interior_probe.rs`) gives 16 shapes in the
|
||||
preview's 286 × 310 box (one unit per CSS px) with the core's verdict and widest disc. For each, the browser's own fill
|
||||
(`pointer-events="fill"`, stroke out) is sampled every 0.25 px and its widest disc taken by an exact distance transform:
|
||||
the core never claims more than the browser fills (at most 0.5 px under it); the 9 refused fill no 4 px disc in any
|
||||
engine (the ninth, an arc radius of `1e-49`, fills nothing at all); the 6 accepted take a real click or tap at the core's centre and the hit test at 32 points of 90 % of its radius,
|
||||
the core never claims more than the browser fills (at most 0.5 px under it); the 10 refused fill no 4 px disc in any
|
||||
engine (an arc radius of `1e-49` and an arc between endpoints one `f32` point apart fill nothing at all); the 6 accepted take a real click or tap at the core's centre and the hit test at 32 points of 90 % of its radius,
|
||||
fill only and as shipped. A drawing root `fill-rule="evenodd"` leaves the pentagram filled at its centre (isolation).
|
||||
Then the equine shapes in the canvas: the core's disc hit test-clear (samples under a point's disc aside, at most a
|
||||
quarter), and a real press where the fill lies farthest from every disc records the zone.
|
||||
@@ -4416,10 +4416,23 @@ reader). Informational: verdict and preview may differ by a libm ulp between nat
|
||||
threshold; the verdict has no production caller yet (V1-2.3). Verifier ECARTS(3), all documentation: this section's
|
||||
pointer from §12.13, the × 1.235 assertion, the audit tools committed.
|
||||
|
||||
Mutations (`.claude/audits/2026-11-01-v1-2-2-mutations-interior.py`): 26 killed, 2 equivalent: Z22 (the floor prune
|
||||
Second security review, on `03be75b`: PASS, the radius MEDIUM closed, two siblings of the same `f32` class, fixed. Browsers
|
||||
store path points in `f32`: an arc whose endpoints are one `f32` point (`A20 20 0 1 1 40.000001 50` from `40 50`) draws
|
||||
nothing there, while `f64` drew a full circle; the core now compares the endpoints as stored and draws no arc either
|
||||
(`an_arc_between_endpoints_equal_in_f32_draws_nothing`, probe `arc-endpoints-equal-in-f32`). An ill-conditioned arc (a
|
||||
flat ellipse along its chord) moves far for one ulp of an endpoint: the core draws the same arc with an endpoint or a
|
||||
radius moved by one `f32` ulp (six variants), adds the largest distance between them at 33 parameters to the deviation,
|
||||
and adds the variants' extremes to the bounds (`an_ill_conditioned_arc_carries_its_f32_spread`: the reported needle,
|
||||
18 units past the chord, inside the bounds; a semicircle of radius 1 000 keeps 0.84 units, its centre moving as the square
|
||||
root of an ulp, as in the browsers). An estimate of the browser's input rounding, compared point to point; the arc
|
||||
arithmetic drift raised to `4 × 2⁻²³` of the radius. Bounds of every arc grow by a few ulps (an arc flush with the frame's
|
||||
edge counts them). LOW kept, pre-existing, outside the diff: relative commands accumulate in the browser's `f32` current
|
||||
point; the worst aligned case (4 096 segments at the 256-span offset limit) drifts 6 % of the span, contrived.
|
||||
|
||||
Mutations (`.claude/audits/2026-11-01-v1-2-2-mutations-interior.py`): 29 killed, 2 equivalent: Z22 (the floor prune
|
||||
removed; a cell that cannot reach the floor never holds an accepted disc) and Z25 (a path without an outline accepted;
|
||||
unreachable). S1, S8 and F16 of the previous scripts, whose anchors moved, re-anchored and killed. Module 579 357 B gzip -9
|
||||
(native build; +5 124 B, budget 600 000, margin 20 643 B).
|
||||
unreachable). S1, S8 and F16 of the previous scripts, whose anchors moved, re-anchored and killed. Module 580 438 B gzip -9
|
||||
(native build; +6 205 B, budget 600 000, margin 19 562 B).
|
||||
|
||||
Ignored cargo tests: the three are one test, `pdf_serialize::l_report_with_real_rasters_costs_what_it_costs`, counted
|
||||
once per cargo run whose features build `pdf_serialize` (workspace, `cli`, `ts,pdf-read,pdf-write`). A timing print for
|
||||
|
||||
@@ -1048,7 +1048,7 @@ Four stages, each a superset of the previous:
|
||||
| Every reachable drawing present, size and sha256 equal to its row, read without removal, in the stored form of §9.2 | yes | | | `verification.integrity.*` |
|
||||
| Every annotation entirely inside the frame of its view, edges included: the view's `view_box`, else the `viewBox` of the drawing it draws, read as a browser reads it (four numbers, positive width and height) and usable within the range rules browsers draw faithfully (owner brief 2026-11-01: edges within 2²⁰, spans from 1 unit, aspect at most 100, farthest edge at most 256 smaller spans); curves and arcs measured on their shape; path data a browser would not read whole refused; a view drawn on a clean drawing without either has no frame. Measured on the views whose drawing reads clean; the document is never rewritten (owner brief 2026-10-30, RUST.md §12.11) | yes | | | `verification.validation.out_of_frame` (issues `annotation.geometry.out_of_frame`, `view.frame.unknown`) |
|
||||
| Every annotation in frame shows at least 4 CSS px on the smallest preview, the editor at 320 × 568 (main view box 286 × 310, detail view box 254 × 191, `xMidYMid meet`): a point's visible disc (`2 × max(2, r − 12)`), a trigger circle's diameter, a polygon's or a path's smaller side (curves and arcs on their shape). Same views, same frame; the document is never rewritten (owner brief 2026-11-01, RUST.md §12.13) | yes | | | `verification.validation.marker_too_small` (issue `annotation.geometry.too_small`) |
|
||||
| Every polygon or path annotation in frame fills a disc of 4 CSS px on the same preview: under the `nonzero` rule the layer fills with, its stroke left out, a centre inside the fill at least the radius from every edge (closing edges included), curves and arcs cut into chords whose deviation is taken off; measured within `interior::MAX_OUTLINE_VERTICES` 4 096 vertices and one budget of `2²⁵` edge distances per sheet, refused past them; refused in doubt (owner brief « fermeture du dernier MEDIUM » 2026-11-01, RUST.md §12.14) | yes | | | `verification.validation.marker_interior_too_small` (issue `annotation.geometry.interior_too_small`) |
|
||||
| Every polygon or path annotation in frame fills a disc of 4 CSS px on the same preview: under the `nonzero` rule the layer fills with, its stroke left out, a centre inside the fill at least the radius from every edge (closing edges included), curves and arcs cut into chords whose deviation is taken off; arcs modelled as browsers store them (`f32` endpoints, a radius other than zero at least `2⁻²⁰`, the spread of one `f32` ulp added); measured within `interior::MAX_OUTLINE_VERTICES` 4 096 vertices and one budget of `2²⁵` edge distances per sheet, refused past them; refused in doubt (owner brief « fermeture du dernier MEDIUM » 2026-11-01, RUST.md §12.14) | yes | | | `verification.validation.marker_interior_too_small` (issue `annotation.geometry.interior_too_small`) |
|
||||
| Fingerprint computed | yes | | | `verification.integrity.fingerprint` |
|
||||
| Verdict passed, on the current revision | | yes | yes | `verdict.missing`, `verdict.failed`, `verdict.stale` |
|
||||
| No `to_confirm` element (D2) | | yes | yes | `publish.to_confirm.open` |
|
||||
|
||||
Reference in new issue
Block a user