wai-vector: the raster RS1-RS9 and the frame procedure, with per-frame SHA-256 vectors (D7-3; stacked on #216) #217
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/d7-3-vector-raster"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds the raster to
wai/wai-vector: the stage family RS1–RS9 and the frame procedure (§3.5–§3.10). The corpus gains seven groups whose expected files state the SHA-256 of every frame'sRGBA8Pat every listed size and rate. This is phase D7-3 of D7.Stacked on #216 (D7-2), which is stacked on #215 (D7-1). The branch starts at #216's first head (
2f147d2a) and merges #216's later commit (5b0f2abd), so until both merge this diff also shows their changes. Merge #215, then #216, then this. Nothing is registered.What lands
src/geom.rs, RS1:M ≤ 64·4^n;3·M ≤ 64·4^n) and both closed forms, ini64;cfg(test),cfg(kani)and the new featurei32-forms;src/cover.rs, RS2–RS6:X(y)is the floor of the exact rational.S.D_r ≤ 256·p ≤ 2^22 − 256before it accumulates.src/paint.rs, RS7–RS9:p′ = div255(p·o),s = div255(p′·α), then source-over;k = div255(m·o_g),s = div255(G·k);RGBA8S.src/frame.rs:R(P, S, z, r, g). A run's glyphs are placed and flattened once per glyph ID and moved to each record's origin. Placement offsets do not depend on the origin, and flattening commutes with integer translation.render_request, withsize_unlisted,rate_unlistedandframe_range.The CLI:
render(one frame'sRGBA8P) andhash(every frame's SHA-256 and each clip digest).The vectors: 51 new, 319 in all, and 357 frame digests.
flattenfillsD_r = 256·p, a path of 16,383 points, and §3.13's non-zero seam and even-odd fringerunscompositeRGBA8S)motionclockslicingsha256.jsongains each (vector, size, rate)'s frame digests and clip digest: 66 entries in all.The fuzz now renders the first frame of each accepted payload whose first size costs at most 2^22.
The README names the new groups.
Tests, and the falsification of each
Each test was committed first. Then the code it guards was broken, the named test was shown to fail, the code was restored through git, and the test was shown to pass. Each row is one run, debug, on the dev Mac. The whole table was run again after the merge of #216's last commit (
82aee67c), with the same results.geom::tests::level_boundary(the level atM = 64·4^nand one more, for n = 0..9; the cubic's3·Mboundary) andclosed_form_and_32_bit_identity_at_the_corners(levels 9 and 10)≤→<in the level rulequadratic, M = 64·4^0raster::rows_and_cells_at_negative_coordinates(two polygons, every value equal to review A'score.py)X(y)and the column crossingassertion left == rightraster::the_left_fold(equal, on every canvas pixel, to the fill moved 8 pixels right onto a wider canvas; equal tocore.py; a contour wholly left draws nothing)pixel (0, 1)raster::triangle_pins_v_to_the_snapped_polygon(|v|= 1280 and 512)vbecame 1152 and 384assertion left == rightraster::abutting_run_seam_pixel_is_255(255 at the seam within a run;128 + div255(128·127)across two runs)the seam at (1, 2)raster::j3_triples_and_group_isolationdiv255(p·div255(α·o)); (2) children composited straight into the parenttriple 0: (13, 250, 129); (2) the isolation assertionraster::whole_fill_reversal_changes_nothing(9 pairs, curves included)vquantised in place of|v|rectraster::integer_speed_roll_shifts_whole_pixels(frame k is frame 0 moved 2k rows, and 4k at twice the size)size 0, frame 1, row 21raster::slicing_piece_frames_equal_the_whole(90 frames over three pieces and two rates)τ = t0 + g·Ppiece 1, rate 0, frame 10raster::the_comb_attains_the_density_bound(D_r = 256·16,382, rendered with everyi32addition checked);the_density_assertion_fires_past_the_cap(should_panic: a 16,384-point comb, built past the payload's cap, givesD_r = 2^22)test did not panic as expectedAlso:
raster::render_requestschecks the three request errors,g = u64::MAXamong them.raster::premultiplied_closure_and_the_straight_viewchecksR, G, B ≤ Aon every rendered pixel, andRGBA8S = R_rat(255·c, A).Cross-checks
Every frame, against an independent renderer. A scratch Python renderer reads the payloads with
structand shares no code with the crate.core.py:place_L,place_origin,place_point,contour_curves,flatten_contour,accumulatewith its clipping and left fold,alpha_nz,alpha_eoandrhu.merged_checks.eval_trackanddiv255.All 357 frames match, the 1920 × 1080 and 3840 × 2160 clock frames included, and every
RGBA8Sdigest ofcomposite. With a frame digest and anRGBA8Sdigest planted wrong, it reports both.flatten: all 23 curves' levels and vertices equalcore.level_q,level_c,flat_qandflat_c.The CLI's frame bytes: hashed by
shasum -a 256, they equal the committed digest.P1 holds for curves too. Each flattened vertex is the floor of the exact point on the curve, the same from either end, so a reversed contour flattens to the reversed polyline. The
curvespair shows it.Legs and gate
Locally, on the dev Mac, every vector is identical on three engines:
vectors verify(319 vectors, 934 generated files);wasm32-wasip2under wasmtime 49.0.2: every test, andvectors verify;wasm32-unknown-unknownunder Node 26.11.1:verify.mjs(319 vectors, 278 authoring forms).CI pins wasmtime 38.0.3 and Node 22.
A second instruction-set architecture (SPEC §7 asks it of frozen digests): a static
x86_64-unknown-linux-muslbuild of the tool ranvectors verifyon an x86_64 Linux host. All 319 vectors and 934 generated files are identical.Fuzz at depth: 616,000 inputs from 308 seeds; no panic. 3,553 inputs were accepted, each written back to its bytes, and 3,212 of them were rendered.
Clippy: clean on every target with
--features std, except one lint inwai-ops'ssha256.rs, which this crate includes by path.The wai-rs gate (
gate.sh d7-3): build, lib tests, carriage, the corpus loop (21 of 21), fast kernels, byte-exact, wai-web wasm32 and the neural gates are all GREEN.The tree-wide tests
corpus_provenance,every_decoded_output_states_a_sha256(which reads the grownsha256.json) andsigner_ids_are_labels: green.Public text:
check-public-names.shwith the private list: clean on each of the 125 changed files, one per invocation, and at CI scope;check-comparative-prose.sh,check-no-vanity-metrics.sh,check-wai-section-refs.pyandcheck-workflow-concurrency.sh: clean.Merge notes
wai-vector.yml(native×3,wasip2,node,fuzz);wai-conformance.yml, becausesha256.jsonchanges;no-vanity-metrics.yml. D7-2's filters already cover every path here.🤖 Generated with Claude Code