Skip to content

fix(re): the frame fit and the fine rows choose their elements by the smallest CRC-32 of their Tag, through one shared function, not an even stride by Tag (#2114) - #2123

Merged
DrunkOnJava merged 1 commit into
mainfrom
fix/2114-tag-strides
Nov 21, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
fix/2114-tag-strides

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

The frame fit (frames_vs_ifc.py) and the fine rows of saved_meshes_vs_ifc.py now choose their elements by the smallest CRC-32 of their Tag, as the body scorers have since #2119. Before, they took an even stride over the sorted Tags, which could move every chosen element when one was added or removed (#2114).

The choice now lives in one shared function, ifc_common.tag_sample. mesh_bodies_vs_ifc.class_sample calls it, with the same result as before.

On identical exports of 42 models (ifc.sha256 and diagnostics.json unchanged: only the scorers changed), scored by this branch and by main:

  • mesh_bodies_vs_ifc's output is identical on every model;
  • frames_vs_ifc moves on the 9 models with more than 200 common elements. Each now compares 200 elements, where the stride took 139 to 192. The fit lines move. The residual after Revit's site placement alone stays at median 0.0000 on all 35 models that print it, and its maximum moves on 5: up on the two concrete housing files (4.09 to 4.16 m) and the office permit (0.228 to 0.246 m), down on both timber office files (0.9075 to 0.2175 m). The maximum is still over a sample of 200;
  • the fine rows move on the 10 BIM4LCA files where a class has more than 300 paired elements. Each such class now scores 300, where the stride took 170 to 296. Every element added is within 0.001 ft, like those before it. Nothing outside the fine rows moves.

Motivation

Closes #2114. #2118 tested every vertex of a scored body, #2119 chose a large class's bodies by CRC-32, and #2122 tested every point of a fitting's faces. A search of tools/re for [:: slices, first-N cuts, _CAP, SAMPLE, LIMIT and MAX_ constants and stepped range( loops found these two strides as the last ones that choose what is scored. What else it found:

  • display limits (LISTED, SHOW, LIST_LIMIT), which shorten printed listings, not counts;
  • triangle caps, under which a larger body is counted and not read;
  • wall_top_cover_vs_ifc.py's stations, set by a wall's length;
  • stepped range( loops in mesh_bodies_vs_ifc.py, which cut the work into chunks and reach every item.

Changes

  • tools/re/ifc_common.py: tag_sample(tags, cap), moved from mesh_bodies_vs_ifc.class_sample with its docstring generalised.
  • tools/re/mesh_bodies_vs_ifc.py: class_sample calls tag_sample; saved_mesh_status_vs_ifc.py's import of it is unchanged.
  • tools/re/frames_vs_ifc.py: the 200 centres come from tag_sample; the docstring says how they are chosen.
  • tools/re/saved_meshes_vs_ifc.py: the fine rows' 300 per class come from tag_sample; both docstrings say so.

Testing

Unit tests are banned in this repository: do not add them.

  • Runs. Measure on main's code (339ee7fc), nordic, r2025, fine_mesh=true, scorers="frames_vs_ifc saved_meshes_vs_ifc mesh_bodies_vs_ifc": 44869977616 with this branch's scorers (e1bd4b09), 44869990078 with main's. No step on either side came from the score cache, whose key covers each scorer and every module it imports.
  • Identical inputs. All 42 models have the same ifc.sha256 on both runs.
  • Rows, written before either run was read.
    • mesh_bodies_vs_ifc: identical on all 41 models it scores, fine rows included.

    • frames_vs_ifc: header lines and "elements tagged in both" identical everywhere; the whole output identical on models with 200 or fewer.

      Model Common Compared Fitted residual, median / max (m)
      Core Interior 696 174 → 200 0.0000 / 0.0000, unchanged
      Housing, concrete, as built 444 148 → 200 0.0451 / 4.0467 → 0.0539 / 4.1050
      Housing, concrete, permit 416 139 → 200 0.0472 / 4.0476 → 0.0531 / 4.1054
      Housing, timber, as built 504 168 → 200 0.0392 / 4.1722 → 0.0557 / 4.1555
      Housing, timber, permit 492 164 → 200 0.0407 / 4.1709 → 0.0563 / 4.1549
      Office, as built 957 192 → 200 0.0017 / 0.2058 → 0.0043 / 0.2016
      Office, permit 1,005 168 → 200 0.0049 / 0.2235 → 0.0060 / 0.2418
      Office, timber, as built 1,085 181 → 200 0.0088 / 0.8946 → 0.0037 / 0.2141
      Office, timber, permit 1,056 176 → 200 0.0084 / 0.8969 → 0.0038 / 0.2144
    • saved_meshes_vs_ifc: everything before the fine rows identical everywhere. Only classes over 300 move, and each to 300, every element within 0.001 ft: IfcMember on all 10 files (178 to 296 before), and IfcColumn on the two timber office files (172 and 170). "Sampled elements meshed" rises with them (for example 686 → 808 on the concrete housing as built).

  • Time. The two runs ran on different runners, and the step times moved both ways (the saved_meshes_vs_ifc step on the office as built 316 → 476 s, on the timber office as built 459 → 308 s), so no cost is measured. fine rows print only with fine_mesh=true.
  • Python only: python3 -m py_compile on the five files. No Rust changes.

Audit-honesty checklist

  • Docs reflect the change: the docstrings. Figures quoted in older reports record what the scorers measured then, and are left as they were.
  • No changelog fragment: a measurement tool, nothing a user of the crate sees.
  • No emojis, private paths or internal jargon.

Legal and contribution hygiene

  • Apache-2.0.
  • No Autodesk proprietary content.
  • No fixtures.

Breaking changes

None. class_sample keeps its name and its result.

Review: rvtReview, the maintainer session, wrote this change. As rvtDevelop is not running, it re-reads the diff and approves the change itself on a green head (Griffin, 2026-11-12).

… smallest CRC-32 of their Tag, through one shared function, not an even stride by Tag (#2114)
@DrunkOnJava
DrunkOnJava merged commit 4f4ce4c into main Nov 21, 2026
53 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/2114-tag-strides branch November 21, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scorer's vertex sample moves its 0.01 ft and 0.001 ft columns when a mesh only gains vertices (mesh_bodies_vs_ifc, fitting_faces_vs_ifc)

1 participant