Repository navigation
fix(ci): the BIM4LCA fetcher retries a dropped connection and fails a shorter archive as stale (#766) - #794
Merged
Merged
Conversation
… shorter archive as stale (#766)
DrunkOnJava
added a commit
that referenced
this pull request
Oct 18, 2026
…ver its Export to IFC As says (#792) (RE-188) (#796) ## Summary A curtain wall in a Revit 2024 file is written as `IfcCurtainWall` whatever its "Export to IFC As" says, as Revit 2024's own exporter writes it. On both BIM4LCA office files, that takes the 124 curtain walls rvt-rs wrote as `IfcShadingDevice` back to `IfcCurtainWall`, all 220 matching Revit's export. The export diagnostics also warn with every "Export to IFC As" value the export does not apply, which `category_map`'s documentation already claimed (#792, RE-188). ## Motivation #792 measured 124 office curtain walls that Revit's export writes as `IfcCurtainWall` and rvt-rs as `IfcShadingDevice`. Run [39153127128](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39153127128) found the value is the curtain walls' own (RE-45 owner records of category `Walls`), not misattributed. The cause is the exporter version: - In revit-ifc `IFC_v24.1.0` to `IFC_v24.3.40`, `CurtainSystemExporter.ExportBase` creates every curtain wall as an `IfcCurtainWall` without consulting the export type. - From `IFC_v25.2.0`, it takes the entity from `ExporterUtil.GetProductExportType`, as other elements do. - On floors, Revit 2024 does follow the value: Core Interior's 20 floors set to `IfcShadingDevice` stay correct. For 2025 and 2026 files the maintainer chose to keep following the setting, as the newer exporters' source does. That half is not measured: the RE1 models carry no value. ## Changes - `category_map::export_override_applies(class, release)`: false for a `CurtainWall` in a 2024 file. Its doc cites the revit-ifc tags and says what is and is not measured. - `partition_schema_mvp`: the file's release travels with each element's export value (`m_ifc_export_release`). The writer's `ifc_export_override` consults the rule, so the value stays on the element for the diagnostics. - `export_content::unapplied_export_value` and a diagnostics warning, which counts exported elements whose value names another entity than the one written, by `"<value> on <class>"`. - The wording in `category_map.rs` and `partition_ifc_export_overrides.rs`: `IfcShadingDevice` is proven on floors and disproven on 2024 curtain walls, not "the one proven value". - `docs/status.md`, `docs/supported-profile.md`, the CHANGELOG `[Unreleased]` Fixed entry, and `reports/element-framing/RE-188-curtain-wall-export-as.md`. ## Testing Measure run [39156744563](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39156744563), with `-f nordic=true` and `main` as the base, read the two office files and CI's reference models. The office files are VTT BIM4LCA, CC BY-SA 4.0, each with Revit 2024's own export. | Against Revit's export, by `Tag` (`class_sets_vs_ifc.py`) | main | this PR | |---|---:|---:| | Office as built: Revit's 220 `IfcCurtainWall` written as `IfcCurtainWall` | 96 | 220 | | Office as built: written as `IfcShadingDevice` | 124 | 0 | | Office at building permit: written as `IfcCurtainWall` | 96 | 220 | | Office at building permit: written as `IfcShadingDevice` | 124 | 0 | | Core Interior: Revit's 20 `IfcShadingDevice` (floors) | 20 | 20 | - **Core Interior, Einhoven and the four RE1 models:** every output is byte-identical to main's apart from the timing lines, and none gains a warning. - **The office files:** only `class_sets`, `aggregates`, `names`, the diagnostics and the IFC hash change. - **The as-built file's warning:** it lists 381 elements whose value the export does not apply: `IfcShadingDevice` on `CurtainWall` 124, `IfcWasteTerminal` on `PlumbingFixture` 78, `IfcElectricAppliance` on `ElectricalEquipment` 51, `IfcSpace` on `GenericModel` 42, `IfcFireSuppressionTerminal` on `SpecialtyEquipment` 40, `IfcWall` on `CurtainWall` 21, `IfcSanitaryTerminal` on `Casework` 15, and five groups of 10 elements together. Those values account for the rest of #792's class mismatches, which stay open. - **Not measured:** a Revit 2025 or 2026 curtain wall carrying a value. The 9 wall sweeps Revit writes as proxies are also left open: their exporter path is the same in every version, so this rule does not explain them. The rebase onto main after this measurement (#793 and #794) touches no Rust source. ## Clean room The changes in this PR are based on public byte observations of the BIM4LCA and magnetar models (sources 1 to 3) and on Autodesk's open-source IFC exporter, revit-ifc, for what Revit's own export writes (source 5): `CurtainSystemExporter.ExportBase` and `ExportWall`, `ExporterUtil.GetProductExportType` and `WallSweepExporter`, read at the release tags named above. I have not used Autodesk SDK source, ODA SDK source, leaked internal documentation, NDA material, or decompiled internal Revit implementation code beyond public symbol exports, and I have not copied or translated code from revit-ifc. ## Breaking changes None. Diagnostics gain a warning string; their schema is unchanged. Refs #792
3 tasks done
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
tools/ci/fetch-bim4lca.pyretries a connection dropped in the middle of a body, and fails a shorter replacement archive as a stale pin instead of reporting the host unreachable. These are the two findings Bugbot posted on #789 after it merged.Motivation
The fetcher's exit status decides what tier two does: 0 runs the BIM4LCA targets, 1 fails the job (re-pin), and 2 warns NOT MEASURED and skips them. Two errors landed on the wrong side:
response.read()raiseshttp.client.IncompleteRead, which is not anOSError. Nothing caught it, so the run ended in a traceback with exit 1 and failed the job as a stale pin, for a network blip.Changes
http.client.HTTPException, which includesIncompleteRead, is retried with the URL and OS errors, and ends inUnreachable(exit 2) if it persists.Stale(exit 1) at once, naming the bytes asked for and the pinned size.Testing
End to end, the real script against a local stub host, with a pins file whose one entry is not on disk, so it has to ask the host. Each mode was run with this branch's script and
main's:mainunreachable: ... HTTP Error 416error: the host has no bytes 3951424-4999999: the archive is shorter than the pinned 5000000; re-pin pins-416.tsvContent-Length: 100, then closes after 10 bytesIncompleteRead), exit 1unreachable: ... IncompleteRead(10 bytes read, 90 more expected)This pull request's tier-two run restores the cache, so it does not reach the host. It shows the healthy path is unchanged: five
[ok]lines, and the four targets run.Breaking changes
None.
Refs #766, #789
Note
Low Risk
CI-only fetch retry and error-classification changes; no production runtime or auth/data paths affected.
Overview
Hardens
fetch()intools/ci/fetch-bim4lca.pyso transient network failures and a shrunk archive map to the correct CI exit codes (2 vs 1).HTTP 416 on a byte-range request now raises
Staleimmediately (exit 1, re-pin) when the host’s file is shorter than the pinned archive size, instead of retrying and ending as unreachable.Dropped mid-body reads (
http.client.IncompleteReadviaHTTPException) are caught with URL/OS errors, retried, and only then reported asUnreachable(exit 2)—avoiding a traceback and a false stale-pin failure on a blip.Reviewed by Cursor Bugbot for commit 4c7f191. Configure here.