Repository navigation
research(saved-graphics): deferred history episodes, FacetedTopology9 under normal binding 2 with a winding check, and a set m_bHasScale with a rotation (#1158) (RE-342) - #1449
Merged
Conversation
…he stored normals follow the winding, and a set m_bHasScale on an older InstanceInfo with a rotation (#1158) (RE-342)
…r's run, what they guard and what nothing in CI will catch (#1158)
… hashes equal, the pairs equal, the winding rule keeps 182 of 185 FacetedTopology0 and 336 of 336 FacetedTopology8 (#1158)
DrunkOnJava
marked this pull request as ready for review
November 5, 2026 15:10
…o export reaches, FacetedTopology9 is read in the graphics of 2015 to 2022 only, and a rotation holds 1e-9 (#1158) (RE-342)
…ecked, the binding-0 normals and the runs at the gated head (#1158)
…2 of 92 exports identical, nothing moved, no file exercises the deferred or FacetedTopology9 reading (#1158)
# Conflicts: # docs/format-reconnaissance.md
…alk, the history reading allocates as before, and the probe's winding count takes the arrays as the reader does (#1158) (RE-342)
… the owners whose stops move, and the runs at the final head (#1158)
…, states the route gates unobserved, and says what the research API now refuses (#1158)
…ports identical, the gates pass, the probe outputs unchanged (#1158)
DrunkOnJava
enabled auto-merge (squash)
November 5, 2026 19:08
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Research. #1436 took one of STE1200's four changes (an
InstanceInfowith nom_GRepId) and left out the other three, deferred history episodes,FacetedTopology9under normal binding 2 and a setm_bHasScale, because no file CI can fetch shows them right. STE1200 has since run the probe on their Revit 2020 family atresearch/1158-ste1200-alland posted the counts in discussion #112: 109 deferred episode pointers and 109 episodes read; 325FacetedTopology9objects under binding 2 with 47,968 facets, every stored normal within 0.1 degree of the winding normal;m_bHasScaletrue on 26 identity and 10 rotation instances; 36 owners drawn whole with 48,520 triangles. All five figures agree with what they had published. This PR restores the three, each fail closed, narrower than their branch, and on a route that no export takes.The evidence is that run, quoted as counts the contributor published. It is a reported measurement on a file CI cannot fetch, and the only file that exercises the three. The family is not downloaded, read or run here and never enters the repository, CI or a report beyond those counts. Nothing in CI reaches the three paths, so nothing in CI will catch a regression in them; CI shows only that they change nothing else (below). No export changes, and saved graphics stay a research reading on Revit 2015 to 2022.
Motivation
Discussion #112; #1158 (native readers on Revit 2015 to 2022) and #1190 (W2, W6, W7 on 2015 to 2023). The reason #1436 gave for leaving the three out, that no file shows them right, has changed.
Changes
native_index::creation_episodesis the first step of the native preamble that every phase, parameter and routing reader goes through, and it is unchanged in outcome: a history with any deferred pointer is refused (inline history episodes require a different contract) and so is the file. The new reading is a separate entry point,creation_episodes_with_deferred, reached only throughOptions::deferred_history_episodes(default false, set by the saved-graphics probe alone). The memoised preamble records how many pointers it read, so a default call after a research one is refused, not served the research preamble; the parameter-definition pass is keyed on the option. On the research route: each pointer must be anEpisodereference with the deferred token, the bodies follow the root in list order, the counted section must repeat their GUIDs in order, the stream ends in four zero bytes, and a count over 1,000,000 or any mismatch refuses the history. The default reading allocates exactly what it did.native_saved_mesh: aGPolyMeshonFacetedTopology9is read only throughgraphics_pre2023, whichnative_saved_scenechooses when the file's layout release is below 2023; every other entry point refuses it as before. It is read underm_normalsFlag2 only, and only wherenormals_follow_windingholds: one stored normal per facet, each within 0.1 degree of its facet's winding normal. Collinear or repeated corners, a corner that is not finite or out of range, a stored normal of no length or not a number, a count that differs either way, or a mesh of no facets refuses the whole mesh and the owner stays partial. The stored normal is never taken unchecked and a failed mesh is not redrawn from the winding.FacetedTopology0stays read under binding 0;FacetedTopology0,8and1under binding 2 stay refused, which covers the Snowdon Towers electrical sample where 4,618 of 131,028FacetedTopology0facets disagree with their stored normal (one file, in aGImpostergraph the traversal skips).native_graphics_traversal: a setm_bHasScaleis read only on aGInstancewhoseInstanceInfohas exactlym_Trf,m_symbolIdandm_cda(nom_GRepId) and a rotation matrix: orthonormal rows and a determinant of 1, each within 1e-9, the tolerance the partition readers hold a rotation to. The first version read any orthonormal matrix, mirrors included; the contributor's 36 are 26 identity and 10 rotation, so it is narrowed to that. A mirror, a scale, and the flag on any file of Revit 2023 to 2027 stay refused, and by code: the walk reads a set flag only when it is asked for the graphics of a file of Revit 2015 to 2022 (select_graphics_pre2023_at_detail, which onlygraphics_pre2023calls); every otherselect_graphics_*entry point refuses it before it looks at theInstanceInfo, so a file of 2023 to 2027 whose decodedInstanceInfolackedm_GRepIdwould be refused as onmain. What guards a wrong result: the older schema only, rotations only. This narrows what research(saved-graphics): an InstanceInfo with no m_GRepId is the default representation, and what STE1200's Revit 2020 family still needs (#1158) (RE-342) #1436 landed: anInstanceInfowith nom_GRepIdwas read as the default representation on every route, by the shape of what was decoded (exactlym_Trf,m_symbolId,m_cda); it is now read on the pre-2023 route alone and refused on every other, as before research(saved-graphics): an InstanceInfo with no m_GRepId is the default representation, and what STE1200's Revit 2020 family still needs (#1158) (RE-342) #1436. The decoder drops a field flagged transient without reading it, so a missing key does not say the class declares none, and a default path should not rest on that; all 62 schemas of Revit 2023 to 2027 declare the field, so no export should move. research(saved-graphics): an InstanceInfo with no m_GRepId is the default representation, and what STE1200's Revit 2020 family still needs (#1158) (RE-342) #1436's own results (the 2015 to 2022 samples' pairs, census and the held-out scenes) all come throughgraphics_pre2023, becausenative_saved_scenepicks the route by the file's release, not byOptions::releases. What does not: the flag's meaning on the older schema is unread, and if it marks a scale the matrix does not carry, a mesh through it is wrong and nothing in the file says. In one held-out model 57 owners pass the scale check and enddecoded_saved_graphicswith no primitive, with rotations only as with every orthonormal matrix, so they are not mirrors or scales; what they hold is unexplained, andsaved_meshes::attachleaves an owner with no primitive as it is.normals_follow_winding,rotationanddefault_representation. They prove the rules, not that a file is read right, and not the wiring.probes/examples/probe_re342_saved_graphics_pre2023.rs: takes the research route itself (the threeOptionsset the option; the scene picksgraphics_pre2023by the file's release), so the contributor needs no flag. It counts, perFacetedTopology*class under binding 2, the objects the winding rule keeps and refuses (every object, whatever its normals, with the arrays taken as the reader takes them: a malformed row or an index that is not an unsigned 32-bit integer in range refuses the mesh), and printshistory default reading readorrefused, what every other reader answers the same history.reports/element-framing/RE-342-saved-graphics-pre2023.md(a section 9 and the header lines; no new RE number),changelog.d/research/1158-ste1200-readers.md,docs/format-reconnaissance.md,docs/contribution-map.md.Callers checked for the claim that no export reaches the deferred reading:
creation_episodes_with_deferredis called byread_preamble(when its argument is set) and the probe.read_preamblehas one caller,RevitFile::native_preamble(deferred), which has two:routed_partitions(current-copy routing, passes false) andextract_records(passes the option). Only the probe's threeOptionsliterals name the field.creation_episodesitself is also called by two other probes, which keep refusing. ForFacetedTopology9:graphics_pre2023has one caller,native_saved_scene; the one export that callsnative_saved_scene(saved_meshes::attach_scoped_with_control) builds the defaultOptions, whose releases are 2023 to 2027, andextract_recordsrefuses a file outsideOptions::releasesbefore any graph is read.Testing
No local build. CI's fast jobs, then Measure on the files CI fetches, at
a7ca6ee0, the head that holds every code change (the commits after it are text). All four runs succeeded and were read:-f base=3955ac90 -f nordic=true -f r2025=true -f holdout=true -f samples=true, noifc_flags): theifc.sha256of 111 of 111 models is identical tomain's at3955ac90. They are Autodesk's sample projects of 2015 to 2027 (58), the 24 Revit 2025 models, the four RE1 models, the BIM4LCA office files (4), Core Interior and Einhoven, the 18 held-out models and 1 spent held-out pair. The scorer diff holds one line,Only in measure-head: areas_across_saves.txt. This is the default export; the--saved-meshesvariant was last run at997d5da1(42054606416, 92 of 92) and not repeated, and what changed since narrows what the default routes read (anInstanceInfowith nom_GRepId), which no file of 2023 to 2027 has.same-project gatesona7ca6ee0:success, "pass: 6 samples held to their earlier saves, and the Areas on 4 saves" (check run 127396725106). The three probe runs wroteneutral"NOT MEASURED" check runs of the same name on the same commit (they setscorers=noneor nosamples=true); the newest of the four is one of those, andarm.shreads every run and judges only a success or a failure.997d5da1. So the winding counts held: under binding 2 the rule keeps 182 of 185FacetedTopology0objects and 336 of 336FacetedTopology8and refuses 3, all in the Snowdon Towers electrical sample, and the stop histograms held. Against research(saved-graphics): an InstanceInfo with no m_GRepId is the default representation, and what STE1200's Revit 2020 family still needs (#1158) (RE-342) #1436's state the tables are equal and 15 of 24 pair files move in their stop histograms alone (29 owners change their stops: 21 leave the scale-check stop, 8 gain aGTextstop and a partial primitive; eachrst_basicpair loses 3 scale-check stops and gains 3GTextstops, eachrac_advancedpair keeps its scale-check count, gains 1GTextstop and loses 1 owner with no primitive; none becomes drawn whole). In 3 of the 8 held-out scenes 1, 58 and 2 owners change their stops (57 of the 58 go from partial todecoded_saved_graphicswith no primitive, 182 to 239 in that model); owners drawn whole and their triangles are equal in 8 of 8.history deferred episode pointersis 0 in all 111 reads (34, 59 and 18: 92 distinct open files and the 18 held-out models; and 0 of 13 families, 42011570902); noFacetedTopology9object is in any;history default readingprintedreadon all 111 andrefusedon none. A setm_bHasScaleon the older schema is in 15 open files (15 with an identity matrix, 8 with a mirror, 8 with a uniform scale; none with a rotation that is not the identity) and 3 held-out models, and no owner is drawn whole through it. No export reaches any of the three changes, and STE1200's run is the only evidence of a deferred history read, of aFacetedTopology9mesh and of a body drawn through the flag.history deferred episode pointers 109 1,history episodes read 109 1,history default reading refused inline history episodes require a different contract 1andtopology FacetedTopology9 normals_flag 2 objects the winding rule keeps 325. That 325 holds only if all 325 meshes are well-formed: the count takes the arrays as the reader does, so a malformed row, an index that is not an unsigned 32-bit integer in range, no normals or a count that is not the facets' makes a meshrefuses, where the facet counts would still read 47,968.Beside it (42039874650 and 42039879159, at
fe6ffa76, which printed the binding-0 lines): 134 of the 136FacetedTopology0objects under binding 0 hold a number of stored normals that is not their facets'; the other 2 (Core Interior) look like per-vertex normals whose count equals the facets'. The binding-0 path is left alone:Primitive::normalsis read by a probe, bytransform(which refuses a zero or non-finite normal) and bySerialize;local_meshandraise_embed_hostread vertices and triangles only.The route gates (
self.pre2023 &&and theself.pre2023arguments innative_graphics_traversal.rs) are observed by nothing in CI or Measure: a refactor that passedtruewould leave every hash and output unchanged, because no fetched file of 2023 to 2027 has the shape they exist for. Nothing in CI will catch a regression in the three paths, and the family never enters the repository. A synthetic fixture for the deferred-episode path is proposed in RE-342 section 9.4 and not built: it needs the wire form of a deferred pointer, which only the contributor's family shows, as decoded values. The contributor is asked to run the probe at this PR's head and post the same lines.Breaking changes
None for users: the default reading, the export path and every
Optionsthat does not name the new field behave as onmain, and no export moves. This is research API, outside the semver promise, and it changes what it refuses:native_saved_mesh::graphics*andnative_graphics_traversal::select_graphics*(but for their_pre2023entry points) refuse anInstanceInfowith nom_GRepId, which #1436 had let them read, andOptionshas a new field.native_graphics_traversalaccepts a setm_bHasScaleandnative_saved_meshaFacetedTopology9in casesmainrefused, but only through the_pre2023entry points, for a file of Revit 2015 to 2022 read withOptions::releaseswidened; no export does.Screenshots or output samples
N/A: no output changed (the export runs above).
Related issues
Refs #1158, Refs #1190.
Contributor declaration (CLEANROOM.md)
The changes in this PR are based on public byte observations of Autodesk's sample projects and the files' own
Formats/Latestschemas (accepted source 1) and on STE1200's published findings, counts and patch, offered under Apache-2.0 in discussion #112 (accepted source 3). I have not used Autodesk SDK source, ODA SDK source, leaked internal documentation, NDA material, or decompiled internal Revit implementation code beyond public symbol exports, and I have not copied or translated code from revit-ifc. The contributor's family (a manufacturer-published Revit 2020 family, under its publisher's terms) was not downloaded or read; nothing of it is committed beyond counts the contributor published in the thread.Co-authored-by: STE1200 [email protected]