diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 611d551b9..2672f9f78 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -814,7 +814,7 @@ crates/engine/src/tests/gltf_import.rs); no third-party models are committed. | Crate | Used for | Licence | |---|---|---| -| solidcore (https://github.com/tangency-labs/solidcore, pinned by rev in Cargo.toml) | the Rust port of NVIDIA's SMLib: the second backend behind crates/smlib, which routes an operation to it once it matches the C++ kernel on the kernel-case rig (crates/smlib/src/route.rs) | Apache-2.0 (its NOTICE credits NVIDIA's USD BRep) | +| solidcore (https://github.com/tangency-labs/solidcore, pinned by rev in Cargo.toml) | the Rust port of NVIDIA's SMLib: the B-rep kernel behind crates/smlib | Apache-2.0 (its NOTICE credits NVIDIA's USD BRep) | Linked as a crate; no code from it is copied into SolidCraft. Its licence text and NOTICE go into THIRD-PARTY-LICENSES.txt when `main` regenerates it. diff --git a/Cargo.toml b/Cargo.toml index d35d6674f..67ee7c50e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,8 +31,8 @@ solidcraft-space-mouse = { path = "crates/space-mouse" } solidcraft-mcp = { path = "crates/mcp" } solidcraft-derive = { path = "crates/derive" } solidcraft-3dx-client = { path = "crates/threedx-client" } -# The Rust port of NVIDIA's SMLib (Apache-2.0), the kernel crates/smlib routes operations to once -# they reach parity (crates/smlib/src/route.rs). Pinned; move the rev on its own commit. For a +# The Rust port of NVIDIA's SMLib (Apache-2.0), the B-rep kernel behind crates/smlib. Pinned; +# move the rev on its own commit. For a # local checkout, add `[patch."https://github.com/tangency-labs/solidcore"] solidcore = { path = # "../solidcore/crates/solidcore" }` to a `.cargo/config.toml` outside the repository. solidcore = { git = "https://github.com/tangency-labs/solidcore", rev = "2dbd88b6e9b858144609690eb2860e0beba27e54" } diff --git a/apps/solidcraft-cli/src/profiling.rs b/apps/solidcraft-cli/src/profiling.rs index 3d0b91245..166496de1 100644 --- a/apps/solidcraft-cli/src/profiling.rs +++ b/apps/solidcraft-cli/src/profiling.rs @@ -1,5 +1,5 @@ //! `--profile` and `--profile-out FILE` for `run`, `eval` and `bench-open` (and -//! `SOLIDCRAFT_PROFILE=1` for any command): record where the time goes, SMLib's calls to the +//! `SOLIDCRAFT_PROFILE=1` for any command): record where the time goes, the kernel's calls to the //! commands, print the table to stderr when the command ends (stdout stays the command's JSON) //! and write the spans as a Chrome trace for chrome://tracing or Perfetto. diff --git a/crates/engine/src/schema/diagnostics.rs b/crates/engine/src/schema/diagnostics.rs index 306fe1b1b..4c49049c6 100644 --- a/crates/engine/src/schema/diagnostics.rs +++ b/crates/engine/src/schema/diagnostics.rs @@ -197,8 +197,7 @@ pub struct ProfileParams { /// One category's share of the recorded self time. #[derive(Debug, Serialize, JsonSchema)] pub struct ProfileCategory { - /// `smlib` (SMLib's own time, measured by its C API), `kernel`, `feature`, `doc`, `command`, - /// `import`, `io`. + /// `solidcore` (the kernel's own calls), `kernel`, `feature`, `doc`, `command`, `import`, `io`. pub category: String, pub self_ms: f64, /// Of all recorded self time, 0–1. diff --git a/crates/kernel/src/profile.rs b/crates/kernel/src/profile.rs index f0bd876c9..b4665560c 100644 --- a/crates/kernel/src/profile.rs +++ b/crates/kernel/src/profile.rs @@ -192,9 +192,9 @@ mod tests { let k = row("kernel", "boolean").unwrap_or_else(|| panic!("{rep:?}")); assert!(k.count >= 1 && row("kernel", "box_solid").is_some(), "{rep:?}"); if r.is_ok() { - // The geometry kernel's calls, on whichever answers, are children of the boolean: their - // time is not its self time. - let calls: std::time::Duration = rep.rows.iter().filter(|r| matches!(r.category, "smlib" | "solidcore")).map(|r| r.total).sum(); + // The geometry kernel's calls are children of the boolean: their time is not its self + // time. + let calls: std::time::Duration = rep.rows.iter().filter(|r| r.category == "solidcore").map(|r| r.total).sum(); assert!(calls > std::time::Duration::ZERO && k.self_time < k.total, "{rep:?}"); } } diff --git a/crates/profile/Cargo.toml b/crates/profile/Cargo.toml index 589bd57fd..40afdec98 100644 --- a/crates/profile/Cargo.toml +++ b/crates/profile/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "solidcraft-profile" -description = "SolidCraft profiler: nested, per-thread timed spans of SMLib calls, kernel operations, feature evaluation, commands and imports, as a table and a Chrome trace" +description = "SolidCraft profiler: nested, per-thread timed spans of kernel calls, kernel operations, feature evaluation, commands and imports, as a table and a Chrome trace" version.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/profile/src/lib.rs b/crates/profile/src/lib.rs index 6fae49009..ae9779873 100644 --- a/crates/profile/src/lib.rs +++ b/crates/profile/src/lib.rs @@ -36,7 +36,7 @@ pub const OTHER: &str = "other"; /// One span name's aggregate. #[derive(Clone, Copy, Debug, Default, PartialEq)] pub struct Row { - /// What the span is: `smlib`, `kernel`, `feature`, `command`, `import`, … + /// What the span is: `solidcore`, `kernel`, `feature`, `command`, `import`, … pub category: &'static str, pub name: &'static str, /// Times the span ran. diff --git a/crates/profile/src/tests.rs b/crates/profile/src/tests.rs index 85b3b95c9..1a096d5eb 100644 --- a/crates/profile/src/tests.rs +++ b/crates/profile/src/tests.rs @@ -41,8 +41,8 @@ fn nested_spans_have_self_and_total_time() { let _inner = span("test", "inner"); spin(4); } - // Timed by someone else (SMLib's C API): a child of `outer`. - record("smlib", "call", Duration::from_millis(2)); + // Timed by someone else: a child of `outer`. + record("external", "call", Duration::from_millis(2)); } set_enabled(false); let r = report(); diff --git a/deny.toml b/deny.toml index 6769a3720..11481b2f7 100644 --- a/deny.toml +++ b/deny.toml @@ -13,5 +13,5 @@ allow-wildcard-paths = true unknown-registry = "deny" unknown-git = "deny" allow-registry = ["https://github.com/rust-lang/crates.io-index"] -# solidcore, pinned by rev in Cargo.toml (crates/smlib's second backend). +# solidcore, pinned by rev in Cargo.toml (the kernel behind crates/smlib). allow-git = ["https://github.com/tangency-labs/solidcore"] diff --git a/docs/book/src/guide/getting-started.md b/docs/book/src/guide/getting-started.md index a2ea9724c..6bfd93ee2 100644 --- a/docs/book/src/guide/getting-started.md +++ b/docs/book/src/guide/getting-started.md @@ -334,7 +334,7 @@ To find the slow steps of a script, `--timings` prints how long each command too the measurement: `{"timings": [{"index", "command", "ms"}], "total_ms"}`, with `index` counted from 0. `--profile` adds each command's `profile: {"boolean_ms", "tessellate_ms", "other_ms"}`, its wall time in the kernel's booleans, in tessellation and in everything else, and prints the -profiler's table on stderr: where the time went, SMLib's calls to the commands +profiler's table on stderr: where the time went, the kernel's calls to the commands (`docs/perf.md`, "Where the time goes"); `--profile-out trace.json` also writes the spans as a Chrome trace. `--profile` works on a design or STEP file too. With `--results` as well, the results go in the same object as `results`; `--results` alone still diff --git a/docs/design-container.md b/docs/design-container.md index 2621663a9..9c50c4ce7 100644 --- a/docs/design-container.md +++ b/docs/design-container.md @@ -164,7 +164,7 @@ same triangles, colour and paint; the picture shown while opening draws its tria `cache/model.json` records `solidcraft-model-cache/8`, the producer revision `solidcraft-truck-adapter/4`, the application version, the build (source commit, CPU architecture and OS), the evaluation source (below, with the CPU architecture -and OS), the geometry kernel that computed it (`solidcore` or `smlib`), the SHA-256 of the exact `document.json` (whose blob references pin every +and OS), the geometry kernel that computed it (`solidcore`; earlier builds could write `smlib`, a cache this build evaluates again), the SHA-256 of the exact `document.json` (whose blob references pin every STEP, mesh and image payload) and of `cache/bodies.bin`, the slices, each kernel body's slice and display share, and the model's records. A cache is read back only when the format, the producer, the evaluation source, the platform, the kernel and both diff --git a/docs/perf.md b/docs/perf.md index 2e7c9daf9..7b64405d5 100644 --- a/docs/perf.md +++ b/docs/perf.md @@ -9,8 +9,7 @@ What it records, as nested spans on each thread: | Category | Spans | |---|---| -| `solidcore` | every call into solidcore, the default kernel | -| `smlib` | every SMLib C API call, timed by the C API itself (`steady_clock`), when the C++ kernel is asked for | +| `solidcore` | every call into solidcore, the kernel | | `kernel` | booleans, blends, sweeps, lofts, shell/draft/offset, healing, sewing, conversions, meshing, measuring | | `import` | the stages of a STEP or IGES import: parse, index, each solid, placement, mesh check, convert batches | | `feature` | each feature computed, by its type; `doc evaluate` around them |