Docs and comments: solidcore is the kernel

The profiler's kernel category is `solidcore` (the C API's `smlib` spans
went with the C++ kernel): the docs, the schema's description and the
tests that named it say so. The attribution row, deny.toml and the
workspace manifest describe solidcore as the kernel behind crates/smlib,
not a second backend; docs/design-container.md says a cache an earlier
build wrote on `smlib` is evaluated again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
This commit is contained in:
jyviko
2026-11-02 18:08:03 -05:00
parent 7d7203f9ed
commit 19db2d7c02
12 changed files with 16 additions and 18 deletions
+1 -1
View File
@@ -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.
+2 -2
View File
@@ -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" }
+1 -1
View File
@@ -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.
+1 -2
View File
@@ -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.
+3 -3
View File
@@ -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:?}");
}
}
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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.
+2 -2
View File
@@ -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();
+1 -1
View File
@@ -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"]
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -2
View File
@@ -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 |