Skip to content

research(re-15): geometry probes for slabs, layers, doors, names - #117

Merged
DrunkOnJava merged 8 commits into
mainfrom
cursor/re15-geometry-probes-44c9
Aug 28, 2026
Merged

DrunkOnJava merged 8 commits into
mainfrom
cursor/re15-geometry-probes-44c9

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Aug 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Reverse-engineering progress toward real geometry for open RE-15 P0/P1 issues, kept off the ArcWall finish-line product path. Adds reproducible probes, a dated synthesis report, corpus invariant tests, and two small ArcWall-safe helpers (2024 opening-index decoder + partition name-candidate classifier).

Motivation

Advance falsifiable RE on #87 (slab profiles), #88 (compound layers), #89 (door dims + openings), #86 (real names), with optional recall baselines for #81–#84.

Sibling branch cursor/arcwall-finish-line-44c9 owns src/ifc/mod.rs ArcWall emission — this PR does not rewrite that path.

Changes

  • examples/probe_re15_{names,rect_opening,opening_stride60,compound_layers,slab_profiles,recall_tags}.rs — corpus probes
  • reports/element-framing/RE-15-synthesis.md — confidence-scored findings + next decoder steps
  • src/rect_opening_index.rs — Revit 2024-only decoder for the dominant 60 B ArcWallRectOpening index envelope (not width/height geometry)
  • src/partition_name_candidates.rs — Material/Level/Space-like string classification helpers
  • tests/re15_geometry_invariants.rs — locks confirmed tag drift, opening-index, and name invariants
  • src/lib.rs — module exports only

CI follow-up

  • cargo fmt --all + clippy -D warnings fixes in probe/test code only (unused sample / thickness_plausible, manual_contains, eq_op)
  • Merged fix(deps): clear shared CI advisories blocking finish-line PRs #118 (cursor/deps-advisory-bump-44c9) via merge commit a17b3eb (no rebase/force-push) to clear shared deny/audit/npm advisories — Cargo.toml/Cargo.lock/rvt-py, PartAtom GeneralRef, viewer package-lock.json

Key findings

Finding Confidence
Real Material/Level names in partition UTF-16LE strings (Concrete, Level 1, …) 0.90
2024 ArcWallRectOpening (0x01a7) 60 B fixed index with marker 0x40088204 (~72%) 0.92
That index does not carry door W×H 0.88
Einhoven has 0 filtered ArcWallRectOpening hits 0.85
Standard ArcWall trailers have no exact 4/6/8/10/12″ thickness f64 (H88-1 falsified) 0.80
Naïve slab polylines collide with ArcWall coords on Einhoven; 2024 has ~998 unbound candidates 0.45–0.75

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo deny check / cargo audit (post-fix(deps): clear shared CI advisories blocking finish-line PRs #118 merge)
  • cargo test --release --test re15_geometry_invariants (5 passed)
  • cargo test --release --lib rect_opening_index / partition_name
  • N/A IFC exporter byte-stability — no ArcWall emission changes in src/ifc/mod.rs

Breaking changes

None.

Related issues

Refs #87 #88 #89 #86 #81 #82 #83 #84

Add falsifiable RE-15 probes and a synthesis report toward real
geometry (#87/#88/#89/#86), plus narrowly version-gated helpers:
2024 ArcWallRectOpening 60 B index decoder and partition name
candidate classification. Corpus invariant tests lock the confirmed
findings. Does not touch the ArcWall IFC finish-line path.

Refs #87 #88 #89 #86 #81 #82 #83 #84

Co-authored-by: DrunkOnJava <[email protected]>
cursor Bot pushed a commit that referenced this pull request Aug 28, 2026
Adapt RE-15/#86 name candidates from PR #117 and wire confident
building-storey labels (Level N / Roof / Ground floor) onto elevation-
derived IFC storeys. Keep thickness unresolved per RE-15/#88; leave
openings to #117.

Co-authored-by: DrunkOnJava <[email protected]>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Scan skips last record start
    • Changed both probe scanners from exclusive 0..len.saturating_sub(min) to inclusive 0..=(len - min) with a length guard, matching ArcWallRecord::find_all so offset len - 292 is visited.

Create PR

Or push these changes by commenting:

@cursor push dec307087e
Preview (dec307087e)
diff --git a/examples/probe_re15_compound_layers.rs b/examples/probe_re15_compound_layers.rs
--- a/examples/probe_re15_compound_layers.rs
+++ b/examples/probe_re15_compound_layers.rs
@@ -30,15 +30,17 @@
     } else {
         0x20
     };
-    for i in 0..buf.len().saturating_sub(min) {
-        let tag = u16::from_le_bytes([buf[i], buf[i + 1]]);
-        if tag != ARC_WALL_TAG || buf[i + 2] != 0 || buf[i + 3] != 0 {
-            continue;
+    if buf.len() >= min {
+        for i in 0..=(buf.len() - min) {
+            let tag = u16::from_le_bytes([buf[i], buf[i + 1]]);
+            if tag != ARC_WALL_TAG || buf[i + 2] != 0 || buf[i + 3] != 0 {
+                continue;
+            }
+            let v = u16::from_le_bytes([buf[i + 0x10], buf[i + 0x11]]);
+            if v == variant {
+                out.push(i);
+            }
         }
-        let v = u16::from_le_bytes([buf[i + 0x10], buf[i + 0x11]]);
-        if v == variant {
-            out.push(i);
-        }
     }
     out
 }

diff --git a/examples/probe_re15_opening_stride60.rs b/examples/probe_re15_opening_stride60.rs
--- a/examples/probe_re15_opening_stride60.rs
+++ b/examples/probe_re15_opening_stride60.rs
@@ -24,15 +24,17 @@
         .flatten()
         .collect();
     let mut offs = Vec::new();
-    for i in 0..concat.len().saturating_sub(292) {
-        let tag = u16::from_le_bytes([concat[i], concat[i + 1]]);
-        if tag != ARC_WALL_TAG || concat[i + 2] != 0 || concat[i + 3] != 0 {
-            continue;
+    if concat.len() >= 292 {
+        for i in 0..=(concat.len() - 292) {
+            let tag = u16::from_le_bytes([concat[i], concat[i + 1]]);
+            if tag != ARC_WALL_TAG || concat[i + 2] != 0 || concat[i + 3] != 0 {
+                continue;
+            }
+            let variant = u16::from_le_bytes([concat[i + 0x10], concat[i + 0x11]]);
+            if variant == ARC_WALL_VARIANT_STANDARD {
+                offs.push(i);
+            }
         }
-        let variant = u16::from_le_bytes([concat[i + 0x10], concat[i + 0x11]]);
-        if variant == ARC_WALL_VARIANT_STANDARD {
-            offs.push(i);
-        }
     }
     println!(
         "=== Einhoven ArcWall thickness sweep — {} records ===",

You can send follow-ups to the cloud agent here.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 4bdba44. Configure here.

} else {
0x20
};
for i in 0..buf.len().saturating_sub(min) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scan skips last record start

Low Severity

The exclusive range 0..len.saturating_sub(292) never visits the last legal start of a 292-byte standard ArcWall record. The existing production scanner uses an inclusive bound. A wall packed at the end of the partition is skipped, so trailer and thickness sweeps can undercount.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4bdba44. Configure here.

cursoragent and others added 2 commits August 28, 2026 10:19
Remove unused LoopCandidate::sample and thickness_plausible helper so
clippy -D warnings passes on the RE-15 probe examples.

Co-authored-by: DrunkOnJava <[email protected]>
- Use slice::contains for Level 1 assertion (manual_contains)
- Replace 12.0/12.0 with 1.0 in thickness sweep (eq_op)

Co-authored-by: DrunkOnJava <[email protected]>
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Deps advisories (deny / audit / npm): out of scope for this RE-15 research PR. A shared deps PR will clear cargo-deny / cargo-audit / npm advisory noise (including pyo3/anyhow majors). This PR only lands probe/report/helper + clippy/fmt fixes on branch-owned Rust.

Bump anyhow (≥1.0.103), crossbeam-epoch (≥0.9.20), quick-xml 0.41,
and pyo3 0.29 to clear RUSTSEC advisories that were failing cargo
audit/deny across finish-line PRs. Adapt PartAtom parsing for
quick-xml 0.38+ GeneralRef entity streaming. Run npm audit fix in
viewer/ (nanoid, postcss, vite 8.x patch) so high-severity npm audit
passes without a Vite major bump.

Co-authored-by: DrunkOnJava <[email protected]>
…ry-probes-44c9

Pull in shared Rust/npm advisory bumps from #118 so RE-15 PR #117 clears
deny/audit/npm CI noise without expanding decoder scope.

Co-authored-by: DrunkOnJava <[email protected]>
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Deps advisories cleared via merge of #118 (cursor/deps-advisory-bump-44c9 → merge commit a17b3eb, no rebase/force-push).

Local after merge: fmt / clippy -D warnings / cargo deny check / cargo audit / re15_geometry_invariants (5) + helper lib tests all green. RE-15 probes/reports/helpers retained; no decoder-scope expansion. Not merging to main from this PR.

@DrunkOnJava
DrunkOnJava marked this pull request as ready for review August 28, 2026 10:44
DrunkOnJava added a commit that referenced this pull request Aug 28, 2026
## Summary

Clears the shared cargo-audit / cargo-deny / viewer npm-audit failures
that have been failing unrelated finish-line PRs (#114–#117) on the same
advisories.

**After this merges, #115 / #116 / #117 (and related finish-line
branches) should rebase onto `main`** so they pick up the lockfile fixes
without each re-fighting the same CI jobs.

### Rust (`Cargo.lock` / `Cargo.toml` / `rvt-py`)
| Crate | From → To | Advisory |
|---|---|---|
| `anyhow` | 1.0.102 → 1.0.104 | RUSTSEC-2026-0190 |
| `crossbeam-epoch` | 0.9.18 → 0.9.20 | RUSTSEC-2026-0204 |
| `quick-xml` | 0.36.2 → 0.41.0 | RUSTSEC-2026-0194 / 0195 |
| `pyo3` | 0.24.2 → 0.29.2 | RUSTSEC-2026-0176 / 0177 |

`PartAtom` parsing adapted for quick-xml ≥0.38 (`Event::GeneralRef`
entity streaming; no ignore/pin).

### Viewer npm
`npm audit fix` in `viewer/` (stayed on Vite 8.x):
- `vite` 8.0.9 → 8.2.2
- `postcss` → 8.5.26
- `nanoid` → 3.3.18

## Test plan
- [x] `cargo check --workspace`
- [x] `cargo audit` clean
- [x] `cargo deny check advisories` ok
- [x] `cargo test --lib part_atom` (8 passed)
- [x] `cd viewer && npm audit --audit-level=high` → 0 vulnerabilities
- [ ] CI green on this PR

No product / ArcWall / viewer feature work included.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> PartAtom parsing behavior changed to match a new XML event model;
incorrect entity/whitespace handling could misread family metadata,
while pyo3 upgrades affect the Python wheel ABI surface.
> 
> **Overview**
> Bumps Rust and viewer dependencies to clear **cargo-audit**,
**cargo-deny**, and **npm audit** failures that were blocking unrelated
PRs, with a targeted parser fix for the **quick-xml** major-line
upgrade.
> 
> **Rust:** `quick-xml` **0.36 → 0.41**, `pyo3` **0.24 → 0.29**
(`rvt-py`), plus transitive fixes (`anyhow`, `crossbeam-epoch`).
**`PartAtom::from_bytes`** in `part_atom.rs` is updated for quick-xml
≥0.38: entities stream as **`Event::GeneralRef`** instead of inline
expansion, text is accumulated in **`pending`** and flushed on end tags
(replacing **`trim_text`** + **`BytesText::unescape`**), and category
**`scheme`** attributes use **`normalized_value`**.
> 
> **Viewer:** `viewer/package-lock.json` from **`npm audit fix`** (e.g.
**vite** 8.0.9 → 8.2.2, **rolldown** 1.2.6, **postcss** / **nanoid**
bumps)—dev tooling only, no app feature changes.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
e312d79. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: DrunkOnJava <[email protected]>
DrunkOnJava added a commit that referenced this pull request Aug 28, 2026
## Summary

Deepens the only working real-project typed export path (Revit 2023
ArcWall → IFCWALL) with RE-15 trailer recovery: validated ElementIds,
type-id candidates, base elevations, elevation-derived storeys with
confident partition Level names, a shared partition scan API, and
ElemTable linkage — without inventing wall height or thickness.

## Motivation

Gate B / 0.3.0 / M11 needs the ArcWall path to stop being an IFC-only
side scan with hardcoded thickness/height defaults. Refs #30, #33, #25,
#28. Incorporates low-risk findings from sibling RE-15 PR #117.

## Changes

- `src/arc_wall_record.rs` — singleton trailer decode (`ElementId`,
`TypeId`, base elevation); `height_feet()` from core Z delta
- `src/partition_arc_walls.rs` — shared scan API; storey recovery;
ElementId→partition index; Level-name application
- `src/partition_name_candidates.rs` — adapted from PR #117 (#86); plus
`is_building_storey_name` / `building_storey_name_candidates`
- `src/elem_table.rs` — `index_by_element_id` +
`link_arcwall_element_ids`
- `src/ifc/mod.rs` — shared path; named storeys when confident; property
set; no invented 10 ft height; thickness placeholder + #88-aware
diagnostics
- `reports/element-framing/RE-15-arcwall-trailer-synthesis.md` — trailer
evidence + #117 cross-links
- Corpus / walker integration tests; docs/status honesty pass

## CI follow-ups

- **IfcOpenShell real IFC:** validator accepts one
`IfcRelContainedInSpatialStructure` per non-empty storey (Einhoven: 4
rels / 4 storeys / 24 walls); related-element total must cover
`building_elements`.
- **Viewer Playwright:** drop `unsupported_geometry_missing_level`;
assert `Partial decode`, `/unit|thickness|storey/i`, `storey_count: 4`,
thickness warning.
- **Deps:** `anyhow` 1.0.104, `crossbeam-epoch` 0.9.20, `quick-xml` 0.41
(+ PartAtom parse adapt), `pyo3` 0.29; viewer `npm audit fix`.
- **PartAtom (wheel CI):** sibling `<title>` elements were concatenating
(`racbasicsamplefamily0610 x 0915mm`) after the ArcWall-branch quick-xml
0.41 rewrite. Synced `src/part_atom.rs` pending-buffer + End flush from
#118 (green Python wheels) and added
`later_title_element_replaces_earlier` / entity-chunk unit tests so only
the Atom title text is returned.

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: DrunkOnJava <[email protected]>
Resolve add/add on partition_name_candidates by keeping the Gate B
storey-name filter from main, and keep rect_opening_index from RE-15.

Co-authored-by: DrunkOnJava <[email protected]>
@DrunkOnJava
DrunkOnJava merged commit 7a2f5dd into main Aug 28, 2026
20 checks passed
@DrunkOnJava
DrunkOnJava deleted the cursor/re15-geometry-probes-44c9 branch August 28, 2026 11:41
DrunkOnJava added a commit that referenced this pull request Aug 31, 2026
## Summary

Clears the shared cargo-audit / cargo-deny / viewer npm-audit failures
that have been failing unrelated finish-line PRs (#114–#117) on the same
advisories.

**After this merges, #115 / #116 / #117 (and related finish-line
branches) should rebase onto `main`** so they pick up the lockfile fixes
without each re-fighting the same CI jobs.

### Rust (`Cargo.lock` / `Cargo.toml` / `rvt-py`)
| Crate | From → To | Advisory |
|---|---|---|
| `anyhow` | 1.0.102 → 1.0.104 | RUSTSEC-2026-0190 |
| `crossbeam-epoch` | 0.9.18 → 0.9.20 | RUSTSEC-2026-0204 |
| `quick-xml` | 0.36.2 → 0.41.0 | RUSTSEC-2026-0194 / 0195 |
| `pyo3` | 0.24.2 → 0.29.2 | RUSTSEC-2026-0176 / 0177 |

`PartAtom` parsing adapted for quick-xml ≥0.38 (`Event::GeneralRef`
entity streaming; no ignore/pin).

### Viewer npm
`npm audit fix` in `viewer/` (stayed on Vite 8.x):
- `vite` 8.0.9 → 8.2.2
- `postcss` → 8.5.26
- `nanoid` → 3.3.18

## Test plan
- [x] `cargo check --workspace`
- [x] `cargo audit` clean
- [x] `cargo deny check advisories` ok
- [x] `cargo test --lib part_atom` (8 passed)
- [x] `cd viewer && npm audit --audit-level=high` → 0 vulnerabilities
- [ ] CI green on this PR

No product / ArcWall / viewer feature work included.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> PartAtom parsing behavior changed to match a new XML event model;
incorrect entity/whitespace handling could misread family metadata,
while pyo3 upgrades affect the Python wheel ABI surface.
> 
> **Overview**
> Bumps Rust and viewer dependencies to clear **cargo-audit**,
**cargo-deny**, and **npm audit** failures that were blocking unrelated
PRs, with a targeted parser fix for the **quick-xml** major-line
upgrade.
> 
> **Rust:** `quick-xml` **0.36 → 0.41**, `pyo3` **0.24 → 0.29**
(`rvt-py`), plus transitive fixes (`anyhow`, `crossbeam-epoch`).
**`PartAtom::from_bytes`** in `part_atom.rs` is updated for quick-xml
≥0.38: entities stream as **`Event::GeneralRef`** instead of inline
expansion, text is accumulated in **`pending`** and flushed on end tags
(replacing **`trim_text`** + **`BytesText::unescape`**), and category
**`scheme`** attributes use **`normalized_value`**.
> 
> **Viewer:** `viewer/package-lock.json` from **`npm audit fix`** (e.g.
**vite** 8.0.9 → 8.2.2, **rolldown** 1.2.6, **postcss** / **nanoid**
bumps)—dev tooling only, no app feature changes.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
d4e146a035a291fb82a75f45f5e4e01b788008d2. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: DrunkOnJava <[email protected]>
DrunkOnJava added a commit that referenced this pull request Aug 31, 2026
## Summary

Deepens the only working real-project typed export path (Revit 2023
ArcWall → IFCWALL) with RE-15 trailer recovery: validated ElementIds,
type-id candidates, base elevations, elevation-derived storeys with
confident partition Level names, a shared partition scan API, and
ElemTable linkage — without inventing wall height or thickness.

## Motivation

Gate B / 0.3.0 / M11 needs the ArcWall path to stop being an IFC-only
side scan with hardcoded thickness/height defaults. Refs #30, #33, #25,
#28. Incorporates low-risk findings from sibling RE-15 PR #117.

## Changes

- `src/arc_wall_record.rs` — singleton trailer decode (`ElementId`,
`TypeId`, base elevation); `height_feet()` from core Z delta
- `src/partition_arc_walls.rs` — shared scan API; storey recovery;
ElementId→partition index; Level-name application
- `src/partition_name_candidates.rs` — adapted from PR #117 (#86); plus
`is_building_storey_name` / `building_storey_name_candidates`
- `src/elem_table.rs` — `index_by_element_id` +
`link_arcwall_element_ids`
- `src/ifc/mod.rs` — shared path; named storeys when confident; property
set; no invented 10 ft height; thickness placeholder + #88-aware
diagnostics
- `reports/element-framing/RE-15-arcwall-trailer-synthesis.md` — trailer
evidence + #117 cross-links
- Corpus / walker integration tests; docs/status honesty pass

## CI follow-ups

- **IfcOpenShell real IFC:** validator accepts one
`IfcRelContainedInSpatialStructure` per non-empty storey (Einhoven: 4
rels / 4 storeys / 24 walls); related-element total must cover
`building_elements`.
- **Viewer Playwright:** drop `unsupported_geometry_missing_level`;
assert `Partial decode`, `/unit|thickness|storey/i`, `storey_count: 4`,
thickness warning.
- **Deps:** `anyhow` 1.0.104, `crossbeam-epoch` 0.9.20, `quick-xml` 0.41
(+ PartAtom parse adapt), `pyo3` 0.29; viewer `npm audit fix`.
- **PartAtom (wheel CI):** sibling `<title>` elements were concatenating
(`racbasicsamplefamily0610 x 0915mm`) after the ArcWall-branch quick-xml
0.41 rewrite. Synced `src/part_atom.rs` pending-buffer + End flush from
#118 (green Python wheels) and added
`later_title_element_replaces_earlier` / entity-chunk unit tests so only
the Atom title text is returned.

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: DrunkOnJava <[email protected]>
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.

2 participants