Repository navigation
feat(cli): rvt-diff --elements compares two saves of a model element by element, keyed by the GlobalId the IFC export writes (#1843) - #1852
Conversation
…by element, keyed by the GlobalId the IFC export writes (#1843) HWT-25 compared two saves of a Revit 2027 structural model by hand (#1829) and found 163 beams and 10 columns added in a day, 84 framing members one save drops, and the parts of a layered floor changing GlobalId on every save. rvt::ifc::element_diff takes each element an IFC export writes (folded pieces apart) as its class, name, storey, type, predefined type, material, placement, a digest of its body and every property it writes, and compares two exports by GlobalId: added, removed, changed with the fields that differ, and unchanged. rvt-diff --elements A B prints a summary and, with --json, writes it all (docs/schemas/rvt-diff-elements.schema.json); --redact scrubs names and text values. The tier-1 contract test checks the schema, that a file against itself changes nothing, and that every element of two files is counted once; probe_1843_element_diff runs it on Measure's sample pairs.
…d an element, which every later save moves (#1843) Between Autodesk's 2025 and 2026 saves every element differed in RvtElementRecordGeometry.SourceStream alone (run 43334394489): the stream a save stores an element in is the file's layout, not the element.
|
Interim readings, against the rows above. These runs are on Row 1, self-comparison.
Row 2, pairs (run 43337710630, each 2025 sample against its 2026 save). Every element is counted once on each side, on all five pairs.
What the changes are:
Row 3 is read on the registered run. |
…west vertex, so two exports of one file write the same GrossSideArea and GrossVolume (#1862) (#1863) ## Summary Two exports of one file now write the same wall `Qto_WallBaseQuantities.GrossSideArea` and `GrossVolume` to the last bit. `outer_loop_area` (`src/ifc/mesh_wall_quantities.rs`) summed each boundary loop of a wall side from whichever vertex a `HashMap` yielded first. Each export added the same terms in another order, so the area moved by up to 2e-14 of its value. #1852's element diff, comparing a file's export with itself, listed 4 to 117 walls as changed on seven of eleven models (run [43335692114](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43335692114), table on #1862). No other field or property moved on any of the eleven. ## Motivation `rvt-diff --elements` (#1843, PR #1852) compares the values an export holds. A value that moves from one export to the next shows as a change between two saves that did not change it. ## Changes - `outer_loop_area` sums each loop from its lowest vertex: the loop starts are sorted before the walk. Vertex ids follow the triangles' order, which is the file's. - Whether a face's boundary closes into loops, and so whether it gets a gross area, does not depend on the start order and is unchanged. - Changelog fragment `changelog.d/fixed/1862-outer-loop-order.md`. ## Testing Rows, registered before the runs: 1. Unfiltered Measure against the merge-base: every export's `ifc.sha256` and `diagnostics.json` identical. A written value can move only at the sixth decimal of a wall `GrossSideArea` or `GrossVolume` that sat on a rounding boundary; any such move is listed here by model and wall. The same-project gates pass. 2. #1852's self-diff (`probe_1843_element_diff`, a file's export against itself) on a scratch merge of this branch and #1852: no element changed on any of the eleven models of run 43335692114. Results will be posted here. - [ ] `tools/check-local.sh`: CI is the compiler; `rustfmt --edition 2024 --check` passes locally - [ ] Verified end to end on real Revit files: rows 1 and 2 - [x] Touches the IFC exporter: witness verdicts replay unless row 1 shows Core Interior moved - [ ] Performance: n/a (one sort of a face's loop starts) ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR: no doc states the gross areas move between exports - [x] Changelog fragment under `changelog.d/fixed/` - [x] No limitation resolved or introduced in the docs - [x] Commit message says what and why - [x] No emojis - [x] No private paths or personal details - [x] Not a format finding ## Legal and contribution hygiene - [x] Apache-2.0 - [x] No Autodesk proprietary source, decompiled internals or NDA material - [x] No fixtures ## Breaking changes None. ## Screenshots or output samples None; rows 1 and 2. ## Related issues Closes #1862. Found by #1843's element diff (PR #1852).
… so walls and the curtain parts on them get IsExternal there (#1860) (#1861) ## Summary A wall's type Function is now read on Revit 2026 and 2027 saves as on 2015 to 2025. Walls there, and the curtain members, plates and curtain walls that take `IsExternal` from their wall, get the value the same project's 2025 save gets. Closes #1860. ## Motivation #1852's element diff of each 2025 sample against its 2026 save (run 43334394489) found `IsExternal` present in the 2025 save and absent in the 2026 save on 4,643 elements of `rac_advanced`, 244 of `rac_basic`, 2,244 of each `rme` sample and 9 walls of `rst_basic`. It was never the other way round. `WALL_TYPE_FUNCTION_REVIT_VERSIONS` ended at 2025, the last release measured when it was written, so `attach_wall_type_functions` read nothing on 2026 and 2027. ## Changes - `src/research/partition_schema_mvp/fields.rs`: `WALL_TYPE_FUNCTION_REVIT_VERSIONS` takes 2026 and 2027, and its doc names what measures them. - `changelog.d/fixed/1860-wall-function-2026.md`. - `docs/status.md`: the 2026 and 2027 paragraph lists walls' and their curtain parts' `IsExternal` as written, not unread. RE-346 had left it open ("Some other release list or rule gates it"), and this is that list. ## Testing Unit tests are banned here. The evidence is one unfiltered Measure of this head against its merge-base with `main`: the samples of every year, the BIM4LCA models, the R2025 set, `rac_advanced` and the held-out models. `readers_across_saves.py` (part of `same-project gates`) already holds each 2026 and 2027 save's `Pset_*Common.IsExternal` to its 2025 save's. It fails a value that differs or one written only on the later save, and counts one written only on the 2025 save without failing. That count is what this PR should empty. Rows, registered before the run: 1. **Only 2026 and 2027 saves move.** The exports that differ are the 2026 and 2027 samples, and any 2026 or 2027 model Measure holds (flowbim.ee's house). In each, the only change is `IsExternal` values added to walls and to the curtain members, plates and curtain walls on them. Every other export and `diagnostics.json` is equal except those files' `IsExternal` counts. 2. **Equal to the 2025 save.** `same-project gates` pass, so no `IsExternal` differs from the 2025 save's, and none is written only on the later save. Reported per sample: the `IsExternal` values compared equal before and after. 3. **Against Revit.** On every Revit export of a 2026 or 2027 model the run scores, `IsExternal` "different" and "values Revit does not write" are unchanged or lower. Any line that moves is named here. - [x] `rustfmt --edition 2024 --check` passes. CI runs the rest. - [ ] Exporter output changes: rows 1 and 3. ## Audit-honesty checklist - [x] Changelog fragment, and `docs/status.md`'s 2026 and 2027 paragraph. - [x] No emojis, private paths or jargon. ## Legal and contribution hygiene - [x] Apache-2.0. No Autodesk proprietary content. ## Breaking changes None.
|
The three rows, read: all hold. Run 43353012565 on 1. Self-comparison: holds. On all 41 models read alone, the probe compares two exports of the same file and reports 2. Pairs: holds. On all 25 pairs,
What the pairs show, as the row said it would:
3. No export moves: holds. |
…an export writes twice and says so, and --redact scrubs the paths in what it prints and the parameter names (#1843)
|
The registered run on 1. Self-comparison: holds. On all 41 models read alone the probe reports 2. Pairs: holds. On all 25 pairs 3. No export moves: holds. The run has no base side, so this is read from what changed and from the gates. CI is green at this head. I have asked rvtDevelop to read the duplicate-GlobalId and |
|
Approved at 7206678 by rvtReview, without a second reader. rvtDevelop had not answered the request to read the duplicate-GlobalId and What the re-read covered, at this head:
One gap, not this PR's: |
…d of every path in a string, not the first of each kind (#1871) (#1873) ## Summary `redact_path_str`, which every `--redact` runs a path through, now scrubs the user name of `/home/<name>/` as it does `/Users/<name>/` and `\Users\<name>\`, and scrubs every path of a string where it scrubbed only the first of each kind (a message that named two files kept the second one's user name). A name no separator follows, as in a path an error echoes back (`No such file: /Users/alice`), is scrubbed up to the first space, quote, closing bracket, comma, semicolon or colon, or the end of the string (rvtDevelop's review of this PR; the first version left it alone); a home folder with nothing after it is left as it is. A second commit corrects a module doc that #1825's closing comment promised to correct: `partition_column_nodes.rs` called a column node's two boxes' x and y extents equal. The raw lines of the census's Measure run show 3,519 of its 3,658 comparisons agree to 1e-12 ft (3,165 exactly) and 139 differ by more than 1e-6 ft, none between, so the doc says that and what the test requires of the boxes (1e-9 ft). The closing comment said "equal to 1e-12" without the 139; they are all in `column_cut_extents` (Core Interior 80, Snowdon Towers Architectural 58, the BIM4LCA timber office at permit 1). No code changes there. ## Motivation #1871, found while reading #1852: `rvt-diff --elements --redact` runs its error text through this function, and CI's PII guard already treats `/home/<name>/` as a home path in committed files, so the scrubber and the guard disagreed. The first-path-only behaviour is the same bug in the same loop. ## Changes - `src/redact.rs`: `HOME_PARENTS` holds the three folders that hold one folder per user; `redact_after` walks the whole string and moves past each replacement, so a string that is already redacted comes back unchanged. The doc example shows a Linux path and a string of two. - `changelog.d/fixed/1871-redact-home-paths.md`. - `src/research/partition_column_nodes.rs`: module doc only. ## Testing - The helper is pure, so it has failure-first tests next to it (the pure-helper exception), seven, written as the ways it can leave a name behind or take more than a name: a Linux home folder (fails on `main`), five paths of three kinds in one string (fails on `main`: the second `\Users\` path and both `/home/` paths keep their names), a name no separator follows, as in an echoed path (fails on `main`), a home folder with nothing after it, a folder that only starts like a home folder (`/srv/homework/...`), names with spaces, dots and accents, and a second pass over redacted text. CI's Linux test job runs them with `cargo test --profile ci --lib`. - Committed redacted output: `git grep -I '/home/'` on `main` finds three tracked files, a Dockerfile's `ENV PATH`, CI's PII guard pattern and CONTRIBUTING.md's description of it. None is output of a `--redact` run, so none changes. - Measure, rows registered on #1871 before the run (run 43368277871, unfiltered, against `main` at `9bb58fe1`): `ifc.sha256` identical on 146 of 146, `diagnostics.json` on 121 of 121, no scorer differs beyond what only the head writes, and `same-project gates` pass on `9a7ce531`. The run reads no `--redact` output, so it shows only that no export moves; the helper's behaviour is the seven tests above. The rule for a name no separator follows came after that run, so a second run on `7e825868` (no base side, rows registered on #1871) gives the gates verdict for it and is compared with the first. ## Related issues Closes #1871. Refs #1825.
Summary
rvt-diff --elements A Bcompares two saves of a model element by element. Each file is exported asrvt-ifcexports it, and the elements are keyed by the GlobalId the export writes. It lists the elements added, removed and changed, and for each changed one the fields that differ:--jsonwrites the whole comparison againstdocs/schemas/rvt-diff-elements.schema.json, and--redactscrubs names and text values. The library isrvt::ifc::element_diff. Closes #1843.Motivation
#1843, suggested by HWT-25 on #1829. They compared two saves of a Revit 2027 structural model by hand and found 163 beams and 10 columns added in one day, 84 framing members that one save drops (#1838), and the parts of a layered floor taking new GlobalIds on every save (#1840).
Shape. The issue left open whether this is an
rvt-diff --elementsmode or a new CLI. It is a mode:rvt-diffalready compares two versions of a file, so no binary is added and the README's CLI sentence stays as it is.Changes
src/ifc/element_diff.rs(new, public):element_statesgives oneElementStateper element the export writes, leaving out a piece the writer folds into its owner's body;diff_elementscompares two lists by GlobalId into anElementDiff.#[non_exhaustive].src/bin/rvt_diff.rs:--elements,--json PATH,--limit N(the elements listed per kind, default 20) and--redact. A stream a limit kept out is reported on stderr, asrvt-ifcreports it.docs/schemas/rvt-diff-elements.schema.jsonand its row indocs/schemas/README.md.tests/json_schema_contracts.rs, on the tier-1 synthetic projects with no corpus:probes/examples/probe_1843_element_diff.rs: the counts of a comparison, for Measure'sprobe_pair_release.docs/library.md,changelog.d/added/1843-element-diff.md.Testing
Unit tests are banned here. The contract test above runs the built binary in CI. The evidence on real files is a Measure run of the 2021 to 2027 samples with the probe and
probe_pair_release=2026. Each sample is compared with the same project saved by Revit 2026, and the same run writes thesame-project gatesverdict.Rows, registered before the run:
added=0 removed=0 changed=0, withunchangedequal toleft. A nonzero count would mean an export is not deterministic, and is named.left = removed + changed + unchanged,right = added + changed + unchanged), and the counts are reported per pair. No rule is asserted about how many elements an upgrade save keeps. What the pairs show is read and stated here, including any whole class that is added and removed rather than matched.same-project gatespass.rustfmt --edition 2024 --checkpasses. CI runs the rest of the gate.78516997, read in the comment below (rows 1 to 3 hold).Audit-honesty checklist
changelog.d/<section>/probes/examples/states its FACTLegal and contribution hygiene
Breaking changes
None. A new public module,
rvt::ifc::element_diff, and a newrvt-diffmode.