Repository navigation
Closed
Description
What
An audit of the IFC writer, the glTF, scene-graph and plan-SVG outputs, the viewer and Python bindings and the CLIs, at 1a9aacc7, found these. Each was confirmed by a second reader, and rvtDevelop re-read the ones marked (read). The bindings and CLIs had none. They are grouped by root cause, since each fix goes where the root is.
1. Values from the file reach the output unsafely
- Comment injection (read).
step_writer.rsemit_headerwrites/* {desc} */.descholds the file's PartAtomidand BasicFileInfo version (ifc/mod.rs:1514-1528), escaped withescape. That makes a string literal safe, not a comment: a*/in the id ends the comment, and the rest is written as STEP between the header'sENDSEC;andDATA;. - Non-finite numbers in the IFC, glTF and SVG (read). The walker reads a stored float as a
Floatwhatever it holds (walker.rsread_field_by_type). A NaN reachesIFCPOSITIVELENGTHMEASURE(NaN)through the stair property sets,infreaches a glTF node matrix throughas f32, and NaN reaches a plan path. Finite values of absurd size become infinite downstream: a record box's centre (partition_element_records.rs), and a stair's height from two elevations (native_stairs.rs). The String writers write a non-finite number as given, by their documented contract;write_step_torefuses the file. - A count sum overflows (read).
revit_set_placement.rs:394counts.iter().sum()over decoded stair counts (--revit-set-placement).
2. Recursion depth the file sets
- Host chains in the scene graph (read).
scene_graph.rsbuild_element_noderecurses down host links, which a crafted file can chain door to door. The ring breaker walks every chain from every element with a linearseen.contains, O(n³).step_writer::storey_ofalready stops at 16. - Boolean-cut chains. One
IfcBooleanResultper elevation-profile cut (wall_profile.rscut_body), recursed byemit_solid_shape,solid_meshandDrop. It is about 2,048 deep at most underSKETCH_MAX_CURVES; whether that overflows the viewer's stack needs a build to say.
3. Linear search where a map belongs (quadratic in elements)
step_writer.rstype_objects:groups.iter_mut().find(...)for every element (read).ifc/mod.rsattach_hosted_cut_openings: every cut scans every entity for its host (read).export_content.rsadd_piece_sets: every element written in pieces rescans every entity's property sets.
4. Work with no cap before the allocation
export_content.rscontain_in_spaces: contents × spaces × ring vertices, with no cancellation check.wall_tops.rscovered_pieces: theMAX_RISERScheck comes after millions of rings are made;embeddedsubtracts every neighbour piece, tripling the pieces each time.body_geometry.rsenvelope_slab_mesh: pieces are capped, but not their points (about 8 GB at the cap).mesh_volume.rspartner_ends: one grid cell holds every coincident mullion end, so n² comparisons.
Done when
- Each is fixed where its root is: at decode, in the one function the outputs share, or by the structure that removes the blow-up. Not call site by call site.
- Every export of a real file is byte for byte as before (an unfiltered Measure per PR), and a change the hashes do not see (the scene graph, the plan SVG) is said to be unmeasured.
Found by Tendrils audit workers (DeepSeek), checked by a second worker each.
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix(ifc): the glTF and plan SVG draw an element whose transform or ou…
docs(changelog): a non-finite number made the IFC export fail, not wr…
style(walker): name le_bytes::physical through the module's own import (
fix(research): le_bytes' float reads refuse a number no model holds, …
style(ifc): HashMap through export_content's own import (#1845)
feat(ifc): a reader that stops at its work budget says so in the expo…
fix(cli): rvt-dump gives each stream a file name of its own that Wind…
fix(cli): rvt-dump also prefixes CONIN$, CONOUT$ and the superscript …
fix(ifc): profile-cut chains are written and meshed by a loop, the sc…
docs(changelog): #1846 moves rac_advanced 2024's five first stair run…
fix(ifc): type objects, hosted cuts, piece sets, wall joins, family b…
fix(ifc): the bounds #1848 put on wall tops, envelopes, mullion grid …
fix(ifc): a stored number past any model is read as absent where it i…
fix(ifc): a reader that stops at its work budget leaves the export wr…
fix(cli): rvt-write decodes unpadded base64 to its bytes, and rvt-dum…
chore(release): prepare v0.20.0 (#1869)
DrunkOnJava commentedon Nov 13, 2026
The depth of a boolean-cut chain, measured (run 43420945188 and 43422082815,
probe_1845_boolean_chain_depth, PR #1908), and the change that follows, with its rows registered before the run.#1846 to #1848 closed every item of this issue but one: a chain of boolean cuts is written and meshed by a loop now, but
SolidShapeisDebug,CloneandSerializeby derive and is dropped by the compiler's glue, and each walks the chain by recursion. The probe builds a chain by a loop and runs each operation on a thread of exactly 1 MiB (the viewer's wasm stack; a native thread stands in, so a failure here is not proof of one in the viewer), one child process per depth.dropjson(serde_json)clonedebugMy registered hypothesis (a 4,096-level chain survives all four) was wrong for
cloneanddebug. A wall's chain has one level per cut region of its edited elevation profile, and a profile has at mostSKETCH_MAX_CURVES(4,096) curves, so a region of one curve (a circle) makes a 4,096-level chain possible. Nothing in the export, the glTF, the scene graph or the viewer's bindings clones or prints a model (read: the oneSolidShapeclone is of the body before the cuts are made,from_decoded.rs:332), so the hazard is a library consumer's: a crafted file whose model is cloned or printed.The change (PR to follow):
cut_profiles_from_bodiescuts a wall's regions in its body only up toMAX_BODY_CUTS(512, about 6 times under the depth at whichdebugbreaks and 8 underclone's); a wall with more keeps its regions as its openings, which is what a wall whose regions are not all solids already does, so the openings Revit's export writes are written either way and only the body is not cut. Not a balanced union: a structure no real file produces would be a new IFC shape that nothing here validates.Rows, registered before its run (an unfiltered Measure against the merge-base):
same-project gatescheck passes on the head.docs(changelog): the cut cap's unfiltered Measure reads 146 of 146 ex…
fix(ifc): a wall with more than 512 profile regions to cut keeps them…
research(ifc): a probe drops, clones, prints and serialises a chain o…