Repository navigation
research(ifc): a probe drops, clones, prints and serialises a chain of up to a million boolean cuts on a 1 MiB stack, for the depth #1845 left unmeasured - #1908
Merged
Conversation
…f up to a million boolean cuts on a 1 MiB stack, for the depth #1845 left unmeasured
…ce clone and debug broke at 4,096 and a wall's chain is at most about 2,048
…eaks at 3,072 levels, clone at 4,096, drop and json at 65,536
10 of 11 tasks
DrunkOnJava
added a commit
that referenced
this pull request
Nov 13, 2026
… as its openings, so a crafted file cannot make a boolean chain deeper than Clone or Debug survives (#1845) (#1910) ## Summary A wall's edited elevation profile cuts its regions in the wall's body as a chain of boolean results, one level per region. This stops at 512: a wall with more keeps its regions as its openings (what a wall whose regions are not all solids already does) and has none cut in its body. ## Motivation The last open item of #1845 (after #1846 to #1848): the chain is written and meshed by a loop, but `SolidShape` is `Debug`, `Clone` and `Serialize` by derive and is dropped by the compiler's glue, each recursing over the chain. Measured on a 1 MiB thread (`probe_1845_boolean_chain_depth`, PR #1908, runs [43420945188](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43420945188) and [43422082815](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43422082815)): `debug` breaks at 3,072 levels, `clone` at 4,096, `drop` and `json` at 65,536; a profile of 4,096 curves can make 4,096 regions. My registered hypothesis (a 4,096-level chain survives all four) was wrong for `clone` and `debug`. Nothing in the export, glTF, scene graph or bindings clones or prints a model, so the hazard is a library consumer's. Rows and the reasoning against a balanced union are on [#1845](#1845 (comment)). ## Changes - `src/ifc/export_content/wall_profile.rs`: `MAX_BODY_CUTS` (512) and the check in `cut_profiles_from_bodies`. - `changelog.d/security/1845-body-cut-cap.md`. ## Testing Unit tests are banned in this repository, and no file or fixture here has a wall with more than 512 regions (`gen-fixture` makes scaffolds), so the changed path is not exercised end to end: - [x] Row 1 (registered on #1845): the unfiltered Measure ([43423122492](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43423122492), `31eb90b6` against `0c58ea68`) reads every export and every diagnostics file byte for byte as the base's: 146 of 146 and 121 of 121. No wall of the corpus has more than 512 cut regions. - [x] Row 2: the `same-project gates` check passes on `31eb90b6` (15 samples held to their earlier saves, and the Areas on 4 saves and on the 2021 save). - [ ] This PR's CI (I cannot build locally, so CI is the first compile of this change). - Not measured, and said so: a wall with more than 512 regions; the cap's effect on one is by reading (the existing `else { continue; }` of the same loop leaves a wall's regions as openings). ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR - [x] A user-visible change has its entry as a fragment under `changelog.d/security/` - N/A: no limitation resolved or introduced beyond the cap stated above - [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: no reverse-engineering finding ## Legal and contribution hygiene - [x] I agree this work is licensable under Apache-2.0 - [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content - [x] No new test fixtures ## Breaking changes None for any file here. A crafted file with more than 512 regions in one wall's profile writes that wall's body uncut, with its openings. ## Related issues Closes #1845 once row 1 holds.
DrunkOnJava
marked this pull request as ready for review
November 13, 2026 13:12
Owner
Author
|
Approved at 143e868 by the review bot as a self-approval, under Griffin's answer of 2026-11-12 ("You are allowed to self-approve"): rvtDevelop's session has not read it. A probe-only pull request; I re-read each probe file as if another session had written it, and each ran on Measure and produced the output the issue comments quote. |
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
The probe behind #1910:
probe_1845_boolean_chain_depthbuilds a chain of 1,024 to 65,536 boolean cuts by a loop and drops, clones, prints and serialises it on a thread of exactly 1 MiB (the viewer's wasm stack; a native thread stands in for it), in a child process for each so an overflow costs one line of output. Nosrc/change, no export moves.Motivation
#1845 item 2, after #1846 to #1848 wrote and meshed a boolean-cut chain by a loop:
SolidShapeisDebug,CloneandSerializeby derive and is dropped by the compiler's glue, and each recurses over the chain. The issue left open "whether that overflows the viewer's stack needs a build to say". Hypothesis, registered before the first run: a 4,096-level chain survives all four on 1 MiB.Result, which refutes it for two of the four (Measure 43420945188 and, at finer depths, 43422082815):
dropandjsonhold to 16,384 levels and break at 65,536;cloneholds to 3,072 and breaks at 4,096;debugholds to 2,048 and breaks at 3,072. A profile of 4,096 curves can make 4,096 regions, one circle each. #1910 caps the regions cut in a wall's body at 512.Changes
probes/examples/probe_1845_boolean_chain_depth.rs.Testing
-f probe=probe_1845_boolean_chain_depth -f probe_scorer=- -f models=einhoven -f base=none -f scorers=none: read, posted on Crafted files: file values reach the IFC, glTF and SVG unsafely, host and cut chains set recursion depth, and four writer passes are quadratic #1845 and written into the probe's doc.Audit-honesty checklist
changelog.d/: none, a probeLegal and contribution hygiene
Related issues
Refs #1845 (closed by #1910).