Skip to content

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
DrunkOnJava merged 3 commits into
mainfrom
research/1845-chain-depth
Nov 13, 2026
Merged

DrunkOnJava merged 3 commits into
mainfrom
research/1845-chain-depth

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

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 and, at finer depths, 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

Audit-honesty checklist

  • README / docs reflect the current state after this PR (probe only)
  • A user-visible change has its entry as a fragment under changelog.d/: none, a probe
  • Commit messages describe WHAT changed and WHY
  • No emojis in code, docs, or commit messages
  • No private paths, personal email addresses, or internal jargon in committed files

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0
  • This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content
  • No new test fixtures

Related issues

Refs #1845 (closed by #1910).

…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
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
DrunkOnJava marked this pull request as ready for review November 13, 2026 13:12
@DrunkOnJava

Copy link
Copy Markdown
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.

@DrunkOnJava
DrunkOnJava merged commit b51f1fc into main Nov 13, 2026
63 checks passed
@DrunkOnJava
DrunkOnJava deleted the research/1845-chain-depth branch November 13, 2026 13:32
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.

1 participant