Repository navigation
perf(saved-graphics): read and mesh saved graphics faster, same output - #882
Conversation
- Pointer lookup tables are built once per object graph (cached on `ObjectGraph`) instead of on every `PointerIndex::new`, and the free `pointer()` uses them instead of scanning every edge and object. - The saved-scene passes read graphs with `extract_graphs`, skipping the parameter-definition pass they never used. - Elements are meshed in parallel over the available cores; results are put back in document order, and the first error in that order is the one returned, as before. - The decoded graphs are freed on a background thread. `rvt-gltf --saved-meshes` writes byte-identical .glb files on the six redistributable reference models and the three tier1 fixtures, and the saved scene's elements are identical. One visible difference: the saved scene's `summaries` no longer carry parameter definitions, unit formats and binding context, which `extract_graphs` does not read; nothing in the crate uses them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013R5i8yaee9fxwTCUC1Qkbg
The browser build (wasm32-unknown-unknown, rvt-wasm) cannot spawn threads, so a saved scene read there would panic. There, and on a single core, elements are meshed one after the other and the decoded graphs are freed in place, as before this change. Checked: `cargo check -p rvt-wasm --target wasm32-unknown-unknown`; with the sequential path forced on, `rvt-gltf --saved-meshes` writes byte-identical .glb files on the six reference models and the three tier1 fixtures, as the parallel path does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013R5i8yaee9fxwTCUC1Qkbg
|
Thanks for this, and sorry it sat for two days: fork runs need a maintainer's approval, and I've approved them now. I also merged main into the branch. Since you opened it, #890 moved the I read the diff. The cached lookup is the same pair of maps CI never reaches saved graphics: they're opt-in, and only Measure with |
|
Merged as 7c4e87f. Thank you! Measure confirmed it (run 39956807932,
Saved graphics also had no CI coverage until now; #909 adds an export of Einhoven and Core Interior with |
…em, the only CI that reads saved graphics (#908) (#909) The IfcOpenShell job exports Einhoven and Core Interior with `--saved-meshes`, requires a positive count of bodies drawn from saved graphics for each, and schema-validates both exports: until now no CI job read saved graphics. The CHANGELOG credits n3ur0m4n's #882. Fixes #908.
## Summary Prepares v0.7.0 (RELEASE.md steps 4 to 8): the version files, the `[0.7.0]` changelog section assembled from `changelog.d/`, the README's release section, and corrections to the status docs where they still described the state before RE-212 or before the BIM4LCA office was measured. Merging this is not the release; the signed tag on its squash commit is. ## Motivation Griffin's go-ahead (2026-10-24, about 3:00 PM): tag v0.7.0 once #887, #930, #935, #940, #942 and #943 are on main with CI green. All six have landed, the last at b04c0cb (#930). #934 (`--revit-property-sets`, breaking) and #923 (the `ElementId` newtype, breaking) go in the next release. ## Changes - **Version files** (0.6.1 to 0.7.0): `Cargo.toml`, `rvt-py/Cargo.toml` (and its `=0.7.0` pin on `rvt`), `rvt-wasm/Cargo.toml`, the `rvt` pin in `tools/stream_evidence/Cargo.toml`, `viewer/package.json`, `CITATION.cff` (`date-released: 2026-10-24`), `.release-please-manifest.json`, and the workspace crates' entries in `Cargo.lock` and `fuzz/Cargo.lock`. - **`CHANGELOG.md`**: `python3 tools/release/changelog.py assemble` moved the nine fragments in, then `[Unreleased]` became `[0.7.0] — 2026-10-24`, with an introduction, credits to puzzbobb (#870, #886, #887, #935) and n3ur0m4n (#882), and "Upgrading from 0.6": the research readers behind `unstable-research`, the `#[non_exhaustive]` types, the error variants (and Python's `ValueError`), `SimpleDecoder`, the property set builders' `Vec`, the removed `ifc::pset_validate`, the element walk failing closed, and changed exports. Headings in the assembler's order (Added, Changed, Fixed, Removed, Research), one each. `[Unreleased]` is left empty. - **Entries corrected for the release as a whole**: #847's pipe-port entry said In ports' axes were wrong because their flow direction was not read, and that other family-instance ports had no placement; RE-212 and #943 changed both, and it now gives main's counts (Measure 40126110706, base side: 124 of 124 and 62 of 62 with Revit's axis; joined ports 108 and 53 as Revit's, 10 and 6 opposite). The unjoined-ports entry says Revit 2025 in its headline. RE-215's entry adds the office. - **`README.md`**: "Release 0.7.0 and main", what 0.7.0 adds in brief. The 0.6.1 section listed RE-215 under 0.6.0's additions; it shipped in neither. - **`docs/support-matrix.json`**: - `native-symbol-cut-sizes`: the BIM4LCA office's result, and `user_impact` limited to families whose symbol cuts an outline; - `element-record-mep-connections`: still said HVAC and piping directions, names and descriptions are not read and In ports' axes are reversed; it now states RE-212 (direction, `InPort_`/`OutPort_` names, `Flow` descriptions, axes), keeps SystemType and the electrical description as unread, and lists RE-212's probe, scorer, test and report as evidence. - **`docs/status.md`** and **`reports/element-framing/RE-215-symbol-cut-loops.md`**: the office, which §6 called NOT MEASURED, as measured on 2026-10-24 (Measure 40121636312 and 40122363218): 187 of its 269 doors cut an outline and have Revit's sizes; its 269 windows and other 82 doors are drawn by symbols with no cut loop (#810). ## Testing Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead. - [ ] `tools/check-local.sh` passes: this PR's CI. No code changes; the version string changes the IFC header. - [x] Verified end to end on real Revit files: no behaviour changes; the measurements cited are the runs named above. - [ ] If this touches the IFC exporter: the IFC header carries the version (#417), so both Core Interior `rvt-rs.json` observations and their verdicts are refreshed from this PR's CI run (its `octetproof-core-interior` artifact) in a follow-up commit here, differing only in `witness_version` and the verdict hashes. - N/A: performance. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR - [x] The changelog section is assembled from the fragments; `changelog.py check` passes with none left - [x] Resolved limitations updated (RE-212's in the support matrix, the office's NOT MEASURED) - N/A: no new limitation - [x] Commit messages describe what changed and why - [x] No emojis in code, docs, or commit messages - [x] No private paths, personal email addresses, or internal jargon in committed files - N/A: not a reverse-engineering finding ## Legal and contribution hygiene - [x] Apache-2.0 - [x] No Autodesk proprietary content - [x] No fixtures ## Breaking changes The release's, listed under "Upgrading from 0.6" in `CHANGELOG.md`. This PR itself changes no API. ## Screenshots or output samples N/A: the IFC changes only in its header's version.
|
This shipped in v0.7.0, released today (2026-10-24) on crates.io, PyPI, the release archives and the container image, and it is credited in the release notes. Thank you. |
The parallel meshing joined its workers with expect(), which panics again with a new message and loses the worker's. resume_unwind carries the original panic through, as suggested in the review of DrunkOnJava#882. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ontrol (#1073) rvt-gltf gave no sign of life while converting: the export walked the elements without a WalkerControl, and reading saved graphics, about half the time with --saved-meshes, had no stage. control::Stage gains SavedGraphics (0 then 1/1) and SavedMeshes (one report per element meshed). native_saved_scene::extract_at_detail_with_control, ifc::saved_meshes::attach_with_control and RvtDocExporter::export_with_mode_limits_and_control take a WalkerControl; the existing functions call them with the default one. A cancelled walk stops the export with Error::Cancelled instead of being taken for a failed walk. rvt-gltf --progress prints the lines of rvt-elements --progress. The parallel meshing joins its workers with resume_unwind, so a worker's panic keeps its own message (the note from the review of #882). Measure runs 40557530610 (default) and 40557542838 (ifc_flags=--saved-meshes) against main: the IFC export is byte-identical on every reference model. The .glb is byte-identical with and without the flag (tests/rvt_gltf_progress_cli.rs, on the tier-1 fixture and RE1 Architecture). Closes #1072.
Summary
Saved graphics are read and meshed 10-24% faster by
rvt-gltf --saved-mesheson the reference models (13-40% fora model's full saved scene), and the .glb written is byte-identical.
Motivation
Closes #881. Pointer tables were rebuilt on every lookup, the saved-scene passes paid for a
parameter-definition pass they never use, and elements were meshed serially.
Changes
src/native_parameters.rs:ObjectGraphcaches its pointer lookup tables (edges by source object and offset,objects by token) in a
OnceLock, built on first use; not serialized.src/native_saved_mesh.rs:PointerIndexborrows the cached tables;pointer()resolves through them insteadof scanning every edge and object. Same checks and errors as before.
src/native_saved_scene.rs: the three passes usenative_document::extract_graphs; elements are meshed inparallel over
available_parallelism()workers and put back in document order (the first error in that orderis returned, as before); the decoded records are dropped on a background thread.
Where there are no threads (the browser build, wasm32-unknown-unknown) and on a single core, elements are
meshed one after the other and the records are freed in place, as before.
Testing
tools/check-local.shpasses (fmt, clippy, rustdoc, build, real-file / CLI / contract checks), with thereference models from
tools/fetch-reference-models.shin place.Verified end to end on real files:
rvt-gltf <file> --saved-mesheswrites byte-identical output before andafter on the six redistributable reference models (licences in
research/witness-registry.json) and the threetier1 fixtures. Reproduce:
The sequential path, forced on for the check, writes the same byte-identical files.
cargo check -p rvt-wasm --target wasm32-unknown-unknownpasses.The saved scene serialized as JSON has identical elements; see "Breaking changes" for its summaries.
N/A: does not touch the IFC exporter's output (byte-identical).
Performance change:
tools/bench.shdoes not exercise saved graphics; the before/after on this path is inperf(saved-graphics): saved graphics are read and meshed 10-24% faster with byte-identical output #881.
Audit-honesty checklist
Legal and contribution hygiene
rvt-rs code (caching, parallelism, choice of an existing extraction entry point). The work was done with the
help of Claude, as the commit's
Co-Authored-Bytrailer says, under the same clean-room rules.Breaking changes
native_saved_scene::SavedScene::summariesno longer carryparameter_definitions,unit_formatsandparameter_binding_context, because the passes now useextract_graphs. Nothing in the crate reads them from asaved scene; a caller that needs them can run
native_document::extractitself.Screenshots or output samples
N/A: output is byte-identical.
Related issues
Closes #881.