Repository navigation
fix(ifc): a wall with more than 512 profile regions to cut keeps them as its openings, so a crafted file cannot make a boolean chain deeper than Clone or Debug survives (#1845) - #1910
Merged
Conversation
… as its openings, so a crafted file cannot make a boolean chain deeper than a library consumer's Clone or Debug survives (#1845) The derived Debug of a SolidShape breaks at 3,072 levels of chain on a 1 MiB stack and Clone at 4,096 (probe_1845_boolean_chain_depth, Measure 43422082815), and a profile of 4,096 curves can make 4,096 regions. Nothing in the export clones or prints a model; the cap bounds the depth where the chain is built.
…ports as before (#1845)
DrunkOnJava
marked this pull request as ready for review
November 13, 2026 12:45
Owner
Author
|
Approved at 742f0a9 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 the head sent to it at about 12:45 UTC. I re-read the whole diff (the cap, the single |
10 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Nov 13, 2026
…f up to a million boolean cuts on a 1 MiB stack, for the depth #1845 left unmeasured (#1908) ## Summary The probe behind #1910: `probe_1845_boolean_chain_depth` builds 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. No `src/` change, no export moves. ## Motivation #1845 item 2, after #1846 to #1848 wrote and meshed a boolean-cut chain by a loop: `SolidShape` is `Debug`, `Clone` and `Serialize` by 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](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43420945188) and, at finer depths, [43422082815](https://github.com/DrunkOnJava/rvt-rs/actions/runs/43422082815)): `drop` and `json` hold to 16,384 levels and break at 65,536; `clone` holds to 3,072 and breaks at 4,096; `debug` holds 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 - [x] This PR's CI (clippy over the probes crate is its compile; I cannot build locally): the fast jobs pass. - [x] Measure `-f probe=probe_1845_boolean_chain_depth -f probe_scorer=- -f models=einhoven -f base=none -f scorers=none`: read, posted on #1845 and written into the probe's doc. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR (probe only) - [x] A user-visible change has its entry as a fragment under `changelog.d/`: none, a probe - [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 ## 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 ## Related issues Refs #1845 (closed by #1910).
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
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
SolidShapeisDebug,CloneandSerializeby 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 and 43422082815):debugbreaks at 3,072 levels,cloneat 4,096,dropandjsonat 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 forcloneanddebug. 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.Changes
src/ifc/export_content/wall_profile.rs:MAX_BODY_CUTS(512) and the check incut_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-fixturemakes scaffolds), so the changed path is not exercised end to end:31eb90b6against0c58ea68) 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.same-project gatescheck passes on31eb90b6(15 samples held to their earlier saves, and the Areas on 4 saves and on the 2021 save).else { continue; }of the same loop leaves a wall's regions as openings).Audit-honesty checklist
changelog.d/security/Legal and contribution hygiene
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.