Commit Graph

15 Commits

Author SHA1 Message Date
bherbruck d646586d30 port: geom.context (SmContext, SmNewMarkAndLock, SM_API context)
Adds geom::context (Context with marks/locks, Boolean flag, notify
callbacks, own model size / zone tolerance; MarkLock; MassPropertyBehavior;
create/get_or_create_context), Kernel::context, and wires the
UNPORTED(geom.context) SmTol context overloads (Option<&Context>).
Difftest: 2013 cases, all bit-identical.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:59:25 -04:00
bherbruck 2dafb1b57f merge main into unit/geom.tol
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:47:06 -04:00
bherbruck d0a1b4cdc1 geom.tol: port SmTol / SmRelation (geom::tol) with difftest runner
Tolerance value conversions, model-size default tolerances, system and
null-context zone/xsect/approx tolerances, gap-based edge/vertex zone
tolerances, scaled zeros (unary..quaternary), IsZeroSpeed,
IsDegenerate(Vec3), and Relation (SmRelation). AreParallel /
ArePerpendicular return Unported until geom.vector3d lands. Wires the
SM_IS_ZERO_SQUARED co-port in geom::vector2d to geom::tol.

difftest: 3430 cases, 3209 bit-identical, 221 deferred (geom.vector3d).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:47:00 -04:00
bherbruck 145095156d merge main into unit/nlib.math
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:46:11 -04:00
bherbruck 5b87c40620 nlib.math: port NL_Math, NL_SrfPoly and NL_Util arithmetic and matrix routines
CPoint arithmetic, quadratic solver, float range checks, RealMatrix
(multiply, transpose, LU with and without pivoting, substitution, inverse,
least squares), power-basis surface evaluation and derivatives, array
reallocation. Shim, ffi wrappers, difftest runner and fixtures: 3076 cases
bit-identical to upstream.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:46:03 -04:00
bherbruck 7893507575 shim(topology.database_io): bound word extraction with setw
word_cap is measured from the file before the shim opens it (0 if that
fails), so the unbounded >> into a word_cap+2 buffer could overflow if the
file changed in between. Results are unchanged for words within word_cap
(difftest 2059/2059 pass).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:39:04 -04:00
bherbruck 4fc22393a8 merge main into unit/topology.database_io
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:37:53 -04:00
bherbruck 01980599e3 topology.database_io: port SmDatabaseIO read side with difftest
DatabaseReader (binary reads, byte swapping, ReadType, GoToNextLine) and
InputStream (libstdc++ istream extraction semantics for ASCII readers).
Difftest: 2059 cases (upstream test files, edge cases, generated scripts),
green; 200k-seed run also green. Findings recorded.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:37:40 -04:00
bherbruck 3521865bce merge main into unit/geom.extent3d
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:32:43 -04:00
bherbruck 8e2992b683 geom.extent3d: port SmExtent3d (Extent3d) with difftest runner
Extent3d covers the unit's 61 directly portable functions; the SmExtent1d
interval accessors (geom.extent1d) and SmPseudoBox circumscription
(geom.pseudo_box) are deferred with UNPORTED markers. SmVector3d::GetMaxDimension
and sm_asin are co-ported as private helpers. Adds SmMath.h constants
(BIG_DOUBLE, INFINITE_PARAMETER, ...) and is_infinite_param to math.

difftest: 3086 cases, 3080 bit-identical, 6 deferred (partial).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:32:31 -04:00
bherbruck 34de6d49f1 geom.vector2d: port SmVector2d (Vec2) with difftest runner
Vec2 moves from math to geom::vector2d (re-exported from math). Back-edges
sm_sqrt/sm_acos/sm_asin and SM_IS_ZERO_SQUARED are co-ported as private
helpers. difftest: 4060 cases bit-identical.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:29:32 -04:00
bherbruck 248758e73b nlib.knots: port NL_BasisBasic knot-vector and basis routines
nurbs::knots::KnotVector (NL_KNOTVECTOR) with find_span, find_span_and_mult,
span_count, validate, basis_eval, basis_i_eval, basis_i_derivs and the
parameter checks; SolidError::Nlib + NlibCode for NLib error numbers.
C++ shim, ffi wrapper, difftest runner and fixtures: 1753 fixture + 1200
generated cases, all bit-identical to upstream (50k-seed run also clean).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 15:04:14 -04:00
bherbruck 20f05db09e difftest: C++ vs Rust comparison harness, solidcore-ffi shim build, harness.selftest
solidcore-ffi: build.rs compiles harness/cpp/shim/*.cpp with flags from
bin/cpp/compile_commands.json (or bin/cpp/ffi.env) and links bin/cpp/lib
(feature cpp; empty crate otherwise, builds for wasm32). Per-unit safe
wrappers in src/units/*.rs are auto-registered; call_with_buffer helper.

difftest: Case/Output/Topology model, 1e-9 relative comparison (documented
per-key abs floors only), seeded xoshiro256** generator, fixture loader with
$pts/$upstream_file expansion, deterministic canonical JSON reports, CLI
(--unit/--green/--all/--list/--seeds/--filter/--perturb). Runners in
src/units/*.rs are auto-registered.

harness.selftest: upstream N_BasisEval via FFI vs Rust re-implementation,
28 cases pass bit-identically; --perturb and tests/selftest.rs show a 1e-8
perturbation is caught in every case.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 14:39:07 -04:00
bherbruck f8ceb54f5e harness/cpp: per-test SM_API driver; plan/baseline.md C++ baseline
Adds sm_api_single (run SM_API tests by name), prog_test summary in
run_tests.sh, and records toolchain, build time, stubs and the test
baseline (SM_API 112 pass + 2 stubbed, prog_test 17/17 suites pass).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 14:36:14 -04:00
bherbruck 5c01824151 harness/cpp: CMake build of upstream SMLib/SM_API reference kernel
Static libs (no TBB, -O2 -ffp-contract=off -fPIC) into bin/cpp/lib,
compile_commands.json and ffi.env for solidcore-ffi, SM_API_test_app and
prog_test_app with a stub for the two Examples-based SM_API tests, and a
runner that mirrors the upstream relative TestFiles layout under bin/cpp/run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 14:32:04 -04:00