Claude 5acb2c8ae4 surface.surface_cache_p3: review fixes (boundary edge uses on a split, planes, dispatch gaps)
- SubdivideNode: split into SurfaceCache::subdivide_node_split plus the base class
  ending; TrimSrfCache splits through its own subdivide_node, which re-implants a
  boundary parent's edge uses into the children with TrimSrfCache::implant_edgeuse
  (needs SmEdgeuse::GetUVTrimCurve: those cases defer on topology.edgeuse_p1; poly
  edges on query.poly) instead of dropping them through the base ImplantEdgeuse.
- trim_srf_cache shim and runner: ImplantEu prints every node of the tree (the
  children subdivisions make included); fixture implant_then_split_boundary_leaf.
- FFI accepts planes where it asked for a B-spline cache (an SmPlane is an
  SmBSplineSurface); the generator uses them; the tolerance test reads a plane's
  NURB through base_for_query (found by the new plane cases).
- DISPATCH GAP comments for GetTree's virtual BuildTree and SubdivideNode's GetTree;
  the bare-tree patch data reads (geom.tree, geom.grid, surface_p2) are dispatch
  gaps tagged with their owning units, not surface.surface_cache_p3.
- Stale docs and notes fixed; findings for the review points.

surface.surface_cache_p3: 445 pass, 0 fail, 155 deferred, --perturb 445/445.
surface.trim_srf_cache: 526 pass, 0 fail, 95 deferred, --perturb 526/526.
difftest --green: 117 units, 0 failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RsMto2bEoBSCSCJku4nT4u
2026-10-14 03:30:38 +00:00
2026-10-13 07:14:08 -04:00
2026-10-13 07:40:33 -04:00
2026-10-13 15:58:03 -04:00

solidcore logo: an isometric solid with one filleted edge and a NURBS curve on its top face

solidcore

solidcore is a Rust port of NVIDIA's SMLib: a boundary-representation (B-rep) solid modeling kernel in safe Rust (SMLib is from USD BRep, Apache-2.0).

Solids are exact: shells, faces, loops, edges and vertices bound to analytic and NURBS curves and surfaces. solidcore's first consumer is SolidCraft.

Scope

In scope: the SMLib kernel and the SM_API operation layer of upstream — NURBS math, curve and surface geometry, B-rep topology, intersections, booleans, fillets and chamfers, offset/shell, sweeps and skins, primitives, healing/stitching, mass properties and queries.

Out of scope: upstream's OCCT translators, USD/Hydra integration and Python bindings. See ATTRIBUTION.md.

Goals: no unsafe in the kernel, no panics on bad input, deterministic results, no global state, builds for wasm32-unknown-unknown, and numerical agreement with the C++ to 1e-9 relative with identical topology, verified unit by unit.

Status

About a third ported and verified against the C++: the math, NURBS and curve layers, with surfaces and topology under way. Checklist: plan/PROGRESS.md (updated automatically). Notes and handoff: plan/STATUS.md. Nothing is usable end to end yet (no primitives, booleans or fillets).

Layout

Path Contents
crates/solidcore The kernel library
crates/solidcore-ffi extern "C" bindings to the upstream C++ (feature cpp)
crates/difftest Runs Rust and C++ side by side on the same inputs
harness/cpp Builds the upstream C++ reference into bin/cpp; FFI shims
plan/ Unit list, port order, status, findings
upstream/ Local clone of usd-brep at c9c5979 (gitignored)
bin/ All build output (gitignored)

Building

Requires the stable toolchain (pinned by rust-toolchain.toml, which also installs rustfmt, clippy and the wasm32-unknown-unknown target). Cargo output goes to bin/ (see .cargo/config.toml).

cargo build -p solidcore
cargo test -p solidcore
cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings
cargo check -p solidcore --target wasm32-unknown-unknown   # wasm check

Optional: export RUSTC_WRAPPER=sccache to share compilation caches.

WebAssembly stack size

On wasm32-unknown-unknown the Rust stack lives in linear memory without a guard page, so an overflow corrupts memory instead of aborting. solidcore bounds input-driven recursion, but kernel algorithms (subdivision, intersection, filleting) still recurse legitimately. Link wasm consumers with a larger stack than the ~1 MB default, e.g. in the consumer's .cargo/config.toml:

[target.wasm32-unknown-unknown]
rustflags = ["-C", "link-arg=-zstack-size=8388608"]   # 8 MiB, as a native main thread

Difftest (Rust vs C++)

git clone https://github.com/NVIDIA-Omniverse/usd-brep upstream
git -C upstream checkout c9c5979
harness/cpp/build.sh                                  # C++ reference -> bin/cpp
cargo run -p difftest --features cpp -- --green       # all units marked green
cargo run -p difftest --features cpp -- --unit <unit id>   # one unit

solidcore-ffi and difftest compile without the C++ build; only the cpp feature links it.

Contributing

Contributions are pull requests, one per port unit, and AI agents are welcome:

  1. Pick any unclaimed unit in plan/PROGRESS.md. "Ready" ones are easiest; the others need stubs or co-porting of missing dependencies.
  2. Claim it by opening a draft PR titled port: <unit id> (lowest-numbered PR wins).
  3. Port it, prove it with difftest against the C++ reference, mark the PR ready.

The full rules, style and step-by-step workflow are in AGENTS.md (point your agent at it).

Releasing

solidcore is published to crates.io from CI: bump version in crates/solidcore/Cargo.toml in a PR, merge it, then push a tag solidcore-v<version> (.github/workflows/release.yml, needs the CARGO_REGISTRY_TOKEN repository secret). Only solidcore is published; solidcore-ffi and difftest are test-only. It stays at 0.0.x until it is usable end to end.

Licence

Apache-2.0. See LICENSE, NOTICE and ATTRIBUTION.md. solidcore is an independent project, not affiliated with or endorsed by NVIDIA.

S
Description
No description provided
Readme 1.5 GiB
2026-10-11 21:49:47 +00:00
Languages
Rust 97.1%
Python 1.9%
WGSL 0.5%
JavaScript 0.3%
Shell 0.1%