You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(wasm,scripts): three claims #3182 made that are not true, and the gate that would have caught one (#3191)
itself is correct and unchanged here; what did not land is the review, and
three of its findings were claims the code does not support.
1. The changeset says `IfcDoorStyle` and `IfcWindowStyle` were affected and
implies this change fixes them. It does not. Both carry `has_geometry: false`
in `legacy_entities.rs`, and `styling/prepass.rs:177` plus its siblings in
`gpu_meshes/prepass.rs`, `processing/shard_classes.rs` and
`processing/processor/mod.rs` gate type-geometry candidates on a bare
`IfcType::from_str(name).is_subtype_of(IfcTypeProduct)`, which is false for
any keyword IFC4X3 dropped. Both are discarded before a job exists, so they
never reach the corrected line. The changeset text ships as the changelog and
#3186 has not published yet, so this is correctable in place. #3187 tracks
the nine sites.
2. `batch.rs` justified the unvalidated `content.get(start..end)` with
"`content[start..end]` is the record `decode_and_cache` just parsed". False on
the cache-hit path: `decoder.rs:443` returns the cached `Arc` without reading
`start`/`end`, so only the miss path bounds-checks them. Narrowed to the span
the job carries, with the fail-soft behaviour stated.
3. A test docblock said the six #3172 entities were "deliberately absent"
because #3172 "is still in review". #3172 merged; the sentence was true when
written and false on merge.
The gate that would have caught the first one, derived rather than transcribed:
`check-legacy-entity-coverage.mjs` already extracts the legacy arm keys and the
generated `from_str` names from source and never intersected them. An arm whose
key `from_str` already resolves makes the `Unknown` short-circuit in
`legacy_aware_ifc_type_from_record` skip the remap, reopening exactly the
wasm-vs-native divergence #3179 was filed for. Now checked, with a mutation case
proving it fires.
Also from the review: a Rust test pinning the same invariant behaviourally (it
calls `from_str` for real, where the gate reads source text); a contract test for
`extract_entity_type_name` next to the function rather than only in its caller's
tests; one shared `LEGACY_KEYS` so the two opposite-direction tests cannot drift;
a dead `type_end <= type_start` guard removed (`paren_pos >= 1` always, the one
reachable equality is the empty slice `is_empty` already rejects); and three
dead or duplicated items in `test-wasm-contract.mjs`.
Every new test mutation-verified in both directions.
Copy file name to clipboardExpand all lines: .changeset/wasm-legacy-keyword-labels.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,10 @@
4
4
5
5
Label legacy IFC keywords with their resolved type in the browser, not `"Unknown"`.
6
6
7
-
The native pipeline resolves a legacy keyword through `legacy_entities.rs` and labels the node with its real base type. The browser path did not: the jobs wire carries only `(id, start, end)`, so `batch.rs` rebuilt the type from `entity.ifc_type` — the decoder's bare `IfcType::from_str` — and every keyword IFC4X3 dropped arrived as `Unknown` with the Unknown default colour. `IfcProxy`, the eight `*StandardCase` variants, both `*ElementedCase`, `IfcDoorStyle`, `IfcWindowStyle`, `IfcEquipmentElement` and the three IFC4X3 strata leaves were all affected. Type-exact visibility rules and styling consumers skipped them, and nothing threw.
7
+
The native pipeline resolves a legacy keyword through `legacy_entities.rs` and labels the node with its real base type. The browser path did not: the jobs wire carries only `(id, start, end)`, so `batch.rs` rebuilt the type from `entity.ifc_type` — the decoder's bare `IfcType::from_str` — and a legacy keyword that reached that path arrived as `Unknown` with the Unknown default colour. The 22 `legacy_entities.rs` arms that carry geometry are fixed here, among them `IfcProxy`, the eight `*StandardCase` variants, both `*ElementedCase`, `IfcEquipmentElement`, the three IFC4X3 strata leaves and the six #3172 added. Type-exact visibility rules and styling consumers skipped them, and nothing threw.
8
+
9
+
`IfcDoorStyle` and `IfcWindowStyle` are NOT fixed by this change. The pre-passes gate type-geometry candidates on a bare `IfcType::from_str(name).is_subtype_of(IfcTypeProduct)`, which is false for any keyword IFC4X3 dropped, so both are discarded before a geometry job exists and never reach the corrected line. That is the same defect one layer up; #3187 enumerates the sites.
8
10
9
11
It cannot be recovered from the decoded value: `IfcType::Unknown` stores a CRC32 hash, not the name. It is recomputed from the record instead, which the batch already holds — a short scan to the first `(`, paid only by entities the decoder could not name.
10
12
11
-
Fixing it surfaced a second defect. `extract_entity_type_name` did not trim, so `#71= IFCCOLUMN(` — legal STEP, and what buildingSMART's own `column-straight-rectangle-tessellation.ifc` writes on all 26 of its entity lines — yielded `" IFCCOLUMN"` with a leading space, matching no lookup. The function had no production caller, so its broken contract had never been exercised.
13
+
Fixing it surfaced a second defect. `extract_entity_type_name` did not trim, so `#71= IFCCOLUMN(` — legal STEP, and what buildingSMART's own `column-straight-rectangle-tessellation.ifc` writes on all 26 of its entity lines — yielded `" IFCCOLUMN"` with a leading space, matching no lookup. The function had no production caller, so its broken contract had never been exercised.`extract_entity_type_name` is `pub` in `ifc-lite-core`, so that is a behaviour change on a published Rust surface: it now returns the trimmed name, and `None` rather than `Some(" ")` for a record with only whitespace between `=` and `(`.
0 commit comments