Repository navigation
feat(kernel): S1 — native OCCT kernel, recovery ladder, harness (99.5% on 391 files) - #15
Merged
Merged
Conversation
Plan A was run, not read. crates.io occt-wasm 4.0.0 cannot instantiate its own module (unknown import), and on upstream main both STEP importers trap: the facade writes input to /tmp inside a WASI module whose import list has no `open`. 0% pass rate and a 2.2 s JIT cold start trip two of plan.md §3's overturn criteria, so this lands Plan B. - kernel/stepv-occt.cpp: STEPCAF/IGESCAF/BREP reader into XCAF, walk for names, colours and instances, BRepMesh at a bbox-diagonal- relative deflection, planar buffers in a STEPVMSH file plus a JSON summary that survives failure (exit 3). Run as a subprocess so a crash is contained and the deadline is a kill. - src/occt.rs: subprocess driver with the timeout, and the STEPVMSH decoder, tested against truncation and absurd counts. - examples/harness.rs: per-file verdicts (pass, partial, clean-fail, bad-mesh, crash, timeout), JSONL results, the Markdown gate table. - just fixtures: scripts/fetch-fixtures.py fetches NIST PMI, 300 ABC models, the occt-import-js corpus, a synthetic 221 MB assembly and a malformed set, every download sha256-pinned; the corpus bytes are recorded in the committed tests/fixtures/corpus.sha256. Result on 391 files: 97.2% pass, 0 crashes, 0 timeouts, 0 bad meshes, all 10 malformed files fail cleanly; p95 337 ms under 1 MB; 62–69 ms cold start. The harness also found two kernel bugs, both fixed here: relative input paths silently dropped multi-file assemblies' external references, and OCCT auto-naming inflated the names column. plan.md records the numbers, corrects the tessellateRelative claim (OCCT's per-edge flag, not bbox-relative), and carries the S2 items S1 surfaced: memory cap (a perforated plate peaks at 7.2 GB), per-face colour, and a header-only --info that skips the slow transfer. Not run: `nix flake check` was held by the sage build governor (vnodes 87% over its 80% gate); fmt, clippy -D warnings, tests and docs were run directly through cargo instead. flake.nix also gets the two lint fixes its hooks had been failing on since c888499: `inherit (rust) checks packages` for statix, and `# deadnix: skip` on the five .vig-os bindings that are unused only because mkRustProject does not forward them (the gap plan.md §7 owes devkit an issue for). The managed block's logic is unchanged. Refs: #1
Every face the first meshing pass leaves without triangles now goes down a ladder, each rung on an isolated copy so neighbours' shared edges are never disturbed: clean re-mesh, ShapeFix + re-mesh, re-mesh at a deflection relative to the FACE's size, a degenerate check (zero parametric width or sub-pixel area), relaxed parameters, a UV-grid approximation clipped by the face classifier, and finally outline-only. Which rung produced each face is recorded as a FaceStatus in the contract (STEPVMSH v2), with is_faithful() as the line between drawing normally and drawing with a warning. That is what lets a renderer give approximated and missing faces a broken-face overlay instead of passing them off as the model. Faceless parts are drawn as line segments: LineKind::Sketch when the whole file has no faces (ABC 00000092 is a sketch exported as STEP), LineKind::Construction when they sit beside solids (149 parts in 43 files: construction geometry, axes, PMI curves), which renderers hide by default. Face-by-face diagnosis of the old 2.8%: 4 files needed ShapeFix (a clean re-mesh alone does not help), 4 had faces far smaller than the model or boundaries that self-intersect only at the model-relative deflection, 3 were zero-area exporter slivers rather than holes, and 2 are genuinely unmeshable visible faces (self-intersecting planes; a cone missing its apex edge), now approximated and flagged. Result on the same 391 files: 99.5% faithful (388 pass + 1 wireframe), 2 degraded, 0 partial, 0 crashes, 0 timeouts; p95 under 1 MB unchanged at 335 ms. plan.md §5 "S1 follow-up" records the table. Refs: #1
§7 said stepv's workflows get their credentials once org-config applies the declaration. They don't: otterdog does not reconcile selected_repositories for dummy-valued org secrets (org-config#318), so an org owner has to add stepv to six secret lists by hand (#3). §7 now says so, and records that the declaration merged as org-config#317 and its apply is waiting on the production environment. Every remaining step and owed item now has an issue (#4–#14, plus vig-os/devkit#1810), tabled in §5, so plan.md is the design record and the issues are the tracker. Refs: #1, #3
This was referenced Oct 4, 2026
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.
Description
Step S1 of
plan.md: prove a kernel against a real STEP corpus. Plan A (occt-wasm) was run andfailed its gate, so this lands Plan B: native OCCT 7.9.3 as a subprocess. On 391 files it shows
99.5% of them faithfully; 0 crash and 0 time out.
Type of Change
feat-- New featuredocs-- Documentation onlybuild-- Build system or dependency changesModifiers
!) -- This change breaks backward compatibilityChanges Made
kernel/stepv-occt.cpp: STEPCAF/IGESCAF/BREP → XCAF walk → BRepMesh at a bbox-relativedeflection → the per-face recovery ladder →
STEPVMSHv2 buffers + a JSON summary that survivesfailure (exit 3).
kernel/stress-gen.cppgenerates the stress fixture.src/occt.rs: the subprocess driver (timeout = kill) and theSTEPVMSHdecoder.src/lib.rs:FaceStatus,LineKind,Lines,Part::is_well_formed.examples/harness.rs, plusjust fixtures(scripts/fetch-fixtures.py) with a sha256-pinnedcorpus recorded in
tests/fixtures/corpus.sha256.flake.nix: OCCT plus devkit'snativemodule. Also fixes the statix/deadnix failures thescaffold shipped with (mkRustProject drops the .vig-os hook knobs, so the Rust scaffold fails deadnix/statix devkit#1810).
plan.md: S1 results, corrections (the claim thattessellateRelativeis bbox-relative; thecredentials claim), and an issue for every remaining step.
Verification:
cargo fmt --check,cargo clippy --all-targets -D warnings,cargo test(19)and
cargo docpass locally.nix flake checkdidn't run locally (sage's build governor heldit), so CI on this PR is its first run.
Changelog Entry
Added
Closes #1
Refs #3