Skip to content

red: B83 proxy ports test - #704

Closed
DrunkOnJava wants to merge 1 commit into
mainfrom
red/b83-proxy-ports
Closed

DrunkOnJava wants to merge 1 commit into
mainfrom
red/b83-proxy-ports

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Red check for B83's test (proxy ports nested in their element). Closed once the failing output is recorded.


Note

Low Risk
Test-only change with no production code paths; CI may fail until B83 export work lands.

Overview
Adds a real-file integration test (proxy_ports) that locks in B83: for family instances exported as IfcBuildingElementProxy, every connector port Revit’s reference IFC exposes must appear in rvt-rs’s IFC4 export nested in that proxy via IfcRelNests (not only present on the model).

The test exports RE1-Electrical, RE1-Plumbing, and RE1-Mechanical from RVT_PROJECT_CORPUS_DIR, parses STEP for IFCDISTRIBUTIONPORT keys and nest relationships, and compares against Revit’s RE1-*.ifc for ports whose host element is a proxy. It is intended as a failing (red) gate until exporter behavior matches.

proxy_ports is registered in tools/ci/test-targets.txt so CI and the local gate run it like other corpus-backed real targets.

Reviewed by Cursor Bugbot for commit 33bdc52. Configure here.

@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Red recorded (Corpus health run 37299353664); the test and implementation are in #705.

@DrunkOnJava DrunkOnJava closed this Oct 5, 2026
@DrunkOnJava
DrunkOnJava deleted the red/b83-proxy-ports branch October 5, 2026 10:59
DrunkOnJava added a commit that referenced this pull request Oct 5, 2026
… in it (B83) (#705)

B83, the remainder of B54 (#528). In Revit's export of RE1 Electrical,
30 of the 53 ports sit on elements that both Revit and rvt-rs write as
proxies: panels, receptacles, switches, junction boxes and sensors. RE1
Mechanical has 6 such ports, all on one element (427568). rvt-rs gave
ports only to distribution elements, because it ties each port with
`IfcRelConnectsPortToElement`, which IFC4 restricts to distribution
elements. Revit's own IFC4 export (revit-ifc `ConnectorExporter`) uses
`IfcRelNests` instead and nests every port in its element.

- `attach_family_instance_ports` now gives a proxy one port per symbol
connector, the same way it treats a distribution element (RE-169).
- The writer nests a proxy's ports in it, with one `IfcRelNests` per
proxy (`'NestedPorts'`, `'Flow'`, as revit-ifc names it). Every other
port keeps its `IfcRelConnectsPortToElement`.
- `tools/re/ports_vs_ifc.py` counts nested ports as tied to their
element.

**Red/green.** `tests/proxy_ports.rs` failed on draft #704 (Corpus
health run 37299353664) with 30 of 30 missing on Electrical and 6 of 6
on Mechanical. The failing output is in the test commit.

**Measure** (run 37299621824, this branch's scorers on both sides):

| model | ports before | ports now | Revit | untied | schema findings |
|---|---:|---:|---:|---:|---:|
| RE1 Electrical | 23 | 53 | 53 | 0 | 0 |
| RE1 Mechanical | 144 | 150 | 150 | 0 | 0 |

Only those two models' IFC and port scores change. Their diagnostics
change only in `total_entities` (229 to 259 and 528 to 534). The other
145 outputs are identical.

To follow (B84, which needs the maintainer's approval): nest every port
the way Revit's IFC4 export does. That would change how the existing
`family_instance_ports` and `duct_and_pipe_ports` tests read ties.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes IFC topology for proxy-hosted MEP connectors (new ports and
nesting relationships); behavior is scoped to proxies but affects port
counts and schema relationships on real corpus models.
> 
> **Overview**
> **B83** extends connector port export to family instances written as
**`IfcBuildingElementProxy`**, matching Revit’s IFC4 pattern where
**`IfcRelConnectsPortToElement`** is not valid for proxies.
> 
> **Export model:** `attach_family_instance_ports` now attaches symbol
connector ports to proxies the same way it does for distribution
elements, so electrical/mechanical fixtures (panels, receptacles, etc.)
get the ports Revit’s reference IFC expects.
> 
> **STEP writer:** Ports on proxy hosts are grouped and linked with
**`IfcRelNests`** (`NestedPorts` / `Flow`) instead of
**`IfcRelConnectsPortToElement`**; distribution elements keep the
existing port-to-element relationships. Join **`IfcRelConnectsPorts`**
behavior is unchanged.
> 
> **Validation:** New corpus test `proxy_ports` compares nested proxy
ports against Revit’s `RE1-*.ifc`; CI includes `real proxy_ports`.
Research scorer `ports_vs_ifc.py` treats **`IfcRelNests`** as the
port-to-element tie for proxies.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f8d28c3. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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