Skip to content

Phase 6 item 6.11a: static SVG for HN's logo and arrows (clazel-svg) - #182

Draft
atiernan wants to merge 12 commits into
phase6/6.3-shapefrom
phase6/6.11a-svg
Draft

atiernan wants to merge 12 commits into
phase6/6.3-shapefrom
phase6/6.11a-svg

Conversation

@atiernan

@atiernan atiernan commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Item 6.11a: the new crate clazel-svg, static SVG for exactly the two files Hacker News uses (y18.svg, triangle.svg), behind clazel-image-shape's Decoder. tier = 0; target 1 is not claimed (see "Not done").

What it does

Our own XML tokenizer, the path grammar (M L H V Z, implicit lineto), fill as #rgb/#rrggbb, non-zero fill, the default preserveAspectRatio, an integer rasterizer (16 sub-scanlines, exact horizontal coverage), drawn at the size of the Config given to start. Everything else is refused (broken image), and the document is read twice (validate, then draw) so nothing is ever drawn in part. SVG 2 section numbers are pinned to the 06 October 2026 CR snapshot (SHA-256 in lib.rs); eleven modelling choices are listed there.

Two findings against the plan's text

  • triangle.svg is width="32" height="32" with viewBox="0 0 32 16": intrinsic size 32 by 32 (not 32 by 16), drawn 10 by 10 at HN's background-size: 10px.
  • The plan says "clipped to the viewBox". I clip to the image (SVG 2 3.11), because the triangle's path lies partly outside its viewBox and clipping to it would cut the arrow to a 5 px strip. Not compared with a browser.

Proven (Kani 0.68.0, WSL)

10 harnesses, 10 pass (verify --part crate reports "10 successfully verified harnesses, 0 failures"): number reader, width/height, viewBox, fill, and rasterizer pieces over edges of any i32 coordinates and any buffers (a span adds exactly its overlap; composite alpha properties). Small bounds, listed in the README.

Tested

22 unit tests and 18 conformance tests (Miri: 40 tests pass, 540 s): HN's two files (vendored, provenance in tests/fixtures/hn/SOURCE.md) at 17 sizes against tiny-skia 0.12.0 (solid pixels exact; anti-aliased within 43 of 255; ours within 6 of a 16x-averaged truth, tiny-skia within 41); every chunk size equal; a refusal corpus with the pixel buffer untouched on every error; 25,422 byte mutants. tiny-skia and 3 small crates are dev-dependencies (class test, rows in docs/DEPENDENCIES.md; arrayvec moves from tooling to test).

Not done

  • Kani harnesses for the tokenizer, the path reader, the viewport transform (Map), crossing, blend and the whole step (the 6.3 template) were written and run and did not finish (unwinding failures and out of memory at 6 GB, or 15-minute timeouts on 64-bit symbolic arithmetic). They are not in the crate; the README says so. Those pieces are covered by tests, mutants and the workspace lints only. So no tier 1 claim.
  • The reference is tiny-skia, not resvg (resvg would add 24 packages incl. an XML parser), so the tokenizer has no independent comparison.
  • clazel-image dispatch on image/svg+xml; preserveAspectRatio other than the default; browser comparison.

Verify

cargo xtask check: STATIC CHECKS PASSED (only "clazel-svg: tier 0, below its target tier 1"). cargo xtask verify --changed was not run: my change to xtask/src/status.rs makes it check every crate, which the shared WSL cannot take. Instead, in WSL under the shared lock: verify --part crate clazel-svg --metrics ...: all static checks PASS, kani clazel-svg PASS, conformance clazel-svg PASS (17/17, 448/448, 25422/25422), then FAIL "write crate measurements": git rev-parse HEAD: fatal: not a git repository (the worktree's .git pointer is a Windows path WSL cannot read; environmental). verify --part miri clazel-svg: "40 tests passed under Miri ... MIRI PART PASSED". Windows: cargo clippy --all-targets -D warnings clean, tests pass. CI's full verification has not run.

🤖 Generated with Claude Code

Also in this PR: GPU crash diagnostics in CI (not part of 6.11a)

0c4aeb75 changes .github/workflows/ci.yml's Linux Verify (base) job only. The GPU process is sometimes killed by its seccomp filter for an openat (syscall 257) from a thread named clazel-gpu. That happened in 3 base runs since the Mesa shader cache fix (cb8ecd00), across different tests and branches. The job now keeps core dumps with systemd-coredump, and on failure it prints every thread's stack (coredumpctl info, then gdb's thread apply all bt full for the newest clazel-gpu core). It does not change the sandbox. It only shows which code makes the call the next time the flake happens.

🤖 Generated with Claude Code

atiernan and others added 10 commits November 16, 2026 17:38
…r clazel-svg

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…erface (item 6.11a)

A tokenizer of our own for the XML in scope, the path grammar (M L H V Z),
the section 8.2 viewport transform (xMidYMid meet), an integer rasterizer
(non-zero fill, 16 sub-scanlines with exact horizontal coverage), and the
Decoder implementation that reads the document twice so that nothing is
ever drawn in part. tier stays 0; Kani harnesses in src/proofs.rs, not yet
run. tiny-skia 0.12.0 and its dependencies join the allowlist (class test).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…, mutations

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… fails

The GPU process is sometimes killed by its seccomp filter for an openat
(syscall 257) from a thread named clazel-gpu. It happened in 3 base runs
after the Mesa shader cache fix (cb8ecd0), across different tests and
branches, and the audit line cannot say which code made the call.
systemd-coredump keeps the core (its pipe helper works from inside the
sandbox's namespaces), and a failure step prints every thread's stack
with coredumpctl and gdb.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd changed-crate CI)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	Cargo.lock

This branch is waiting to be deployed

1 waiting deployment
full-verification — 83e48bcd Waiting Nov 19, 2026 by atiernan via Approve the proofs #589
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