@bldrs-ai/conway 1.423.1278 → 1.425.1281

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,7 @@ var import_node_process = require("node:process");
30
30
  var readline = __toESM(require("node:readline"), 1);
31
31
 
32
32
  // compiled/src/version/version.js
33
- var versionString = "Conway v1.423.1278";
33
+ var versionString = "Conway v1.425.1281";
34
34
 
35
35
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
36
36
  var wasmType = "";
@@ -70969,6 +70969,23 @@ var ColumnarIndexSink = class {
70969
70969
  this.expressIdsSorted_ = true;
70970
70970
  this.previousExpressID_ = 0;
70971
70971
  }
70972
+ /**
70973
+ * Snapshot the columns pushed SO FAR into a self-contained prefix index,
70974
+ * without disturbing the sink — the parse can keep pushing afterwards and
70975
+ * a later snapshot/finalize sees the full data. Safe to call between the
70976
+ * cooperative parse's yields (the parser only suspends at top-level
70977
+ * record boundaries, where the sink is consistent). Top-level localIDs
70978
+ * are stable across snapshots (dense parse order), so consumers can carry
70979
+ * per-localID cursors from one snapshot to the next; inline-range
70980
+ * localIDs are NOT stable (the inline tail re-packs after the growing
70981
+ * top-level range) and must not be carried across snapshots.
70982
+ *
70983
+ * @return {StepIndexColumns} A prefix columnar index over the records
70984
+ * pushed so far.
70985
+ */
70986
+ snapshot() {
70987
+ return this.assemble_();
70988
+ }
70972
70989
  /**
70973
70990
  * Assemble the final columns: concatenate the top-level segments (one
70974
70991
  * column at a time, bounding transient overhead to a single column's
@@ -70978,6 +70995,15 @@ var ColumnarIndexSink = class {
70978
70995
  * @return {StepIndexColumns} The finished columnar index.
70979
70996
  */
70980
70997
  finalize() {
70998
+ return this.assemble_();
70999
+ }
71000
+ /**
71001
+ * Shared assembly behind {@link snapshot} and {@link finalize} — pure
71002
+ * over the sink's current state.
71003
+ *
71004
+ * @return {StepIndexColumns} The assembled columnar index.
71005
+ */
71006
+ assemble_() {
70981
71007
  const topLevel = this.count_;
70982
71008
  const unfolded = [];
70983
71009
  for (const entry of this.retained_.values()) {
@@ -14965,7 +14965,7 @@ ${t5.join("\n")}` : "";
14965
14965
  var import_process = require("process");
14966
14966
 
14967
14967
  // compiled/src/version/version.js
14968
- var versionString = "Conway v1.423.1278";
14968
+ var versionString = "Conway v1.425.1281";
14969
14969
 
14970
14970
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
14971
14971
  function pThreadsAllowed() {
@@ -86814,6 +86814,23 @@ var ColumnarIndexSink = class {
86814
86814
  this.expressIdsSorted_ = true;
86815
86815
  this.previousExpressID_ = 0;
86816
86816
  }
86817
+ /**
86818
+ * Snapshot the columns pushed SO FAR into a self-contained prefix index,
86819
+ * without disturbing the sink — the parse can keep pushing afterwards and
86820
+ * a later snapshot/finalize sees the full data. Safe to call between the
86821
+ * cooperative parse's yields (the parser only suspends at top-level
86822
+ * record boundaries, where the sink is consistent). Top-level localIDs
86823
+ * are stable across snapshots (dense parse order), so consumers can carry
86824
+ * per-localID cursors from one snapshot to the next; inline-range
86825
+ * localIDs are NOT stable (the inline tail re-packs after the growing
86826
+ * top-level range) and must not be carried across snapshots.
86827
+ *
86828
+ * @return {StepIndexColumns} A prefix columnar index over the records
86829
+ * pushed so far.
86830
+ */
86831
+ snapshot() {
86832
+ return this.assemble_();
86833
+ }
86817
86834
  /**
86818
86835
  * Assemble the final columns: concatenate the top-level segments (one
86819
86836
  * column at a time, bounding transient overhead to a single column's
@@ -86823,6 +86840,15 @@ var ColumnarIndexSink = class {
86823
86840
  * @return {StepIndexColumns} The finished columnar index.
86824
86841
  */
86825
86842
  finalize() {
86843
+ return this.assemble_();
86844
+ }
86845
+ /**
86846
+ * Shared assembly behind {@link snapshot} and {@link finalize} — pure
86847
+ * over the sink's current state.
86848
+ *
86849
+ * @return {StepIndexColumns} The assembled columnar index.
86850
+ */
86851
+ assemble_() {
86826
86852
  const topLevel = this.count_;
86827
86853
  const unfolded = [];
86828
86854
  for (const entry of this.retained_.values()) {
@@ -15943,7 +15943,7 @@ var ParsingBuffer = class {
15943
15943
  };
15944
15944
 
15945
15945
  // compiled/src/version/version.js
15946
- var versionString = "Conway v1.423.1278";
15946
+ var versionString = "Conway v1.425.1281";
15947
15947
 
15948
15948
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
15949
15949
  function pThreadsAllowed() {
@@ -944,7 +944,7 @@ var EntityTypesIfcCount = 909;
944
944
  var entity_types_ifc_gen_default = EntityTypesIfc;
945
945
 
946
946
  // compiled/src/version/version.js
947
- var versionString = "Conway v1.423.1278";
947
+ var versionString = "Conway v1.425.1281";
948
948
 
949
949
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
950
950
  var wasmType = "";
@@ -70967,6 +70967,23 @@ var ColumnarIndexSink = class {
70967
70967
  this.expressIdsSorted_ = true;
70968
70968
  this.previousExpressID_ = 0;
70969
70969
  }
70970
+ /**
70971
+ * Snapshot the columns pushed SO FAR into a self-contained prefix index,
70972
+ * without disturbing the sink — the parse can keep pushing afterwards and
70973
+ * a later snapshot/finalize sees the full data. Safe to call between the
70974
+ * cooperative parse's yields (the parser only suspends at top-level
70975
+ * record boundaries, where the sink is consistent). Top-level localIDs
70976
+ * are stable across snapshots (dense parse order), so consumers can carry
70977
+ * per-localID cursors from one snapshot to the next; inline-range
70978
+ * localIDs are NOT stable (the inline tail re-packs after the growing
70979
+ * top-level range) and must not be carried across snapshots.
70980
+ *
70981
+ * @return {StepIndexColumns} A prefix columnar index over the records
70982
+ * pushed so far.
70983
+ */
70984
+ snapshot() {
70985
+ return this.assemble_();
70986
+ }
70970
70987
  /**
70971
70988
  * Assemble the final columns: concatenate the top-level segments (one
70972
70989
  * column at a time, bounding transient overhead to a single column's
@@ -70976,6 +70993,15 @@ var ColumnarIndexSink = class {
70976
70993
  * @return {StepIndexColumns} The finished columnar index.
70977
70994
  */
70978
70995
  finalize() {
70996
+ return this.assemble_();
70997
+ }
70998
+ /**
70999
+ * Shared assembly behind {@link snapshot} and {@link finalize} — pure
71000
+ * over the sink's current state.
71001
+ *
71002
+ * @return {StepIndexColumns} The assembled columnar index.
71003
+ */
71004
+ assemble_() {
70979
71005
  const topLevel = this.count_;
70980
71006
  const unfolded = [];
70981
71007
  for (const entry of this.retained_.values()) {
@@ -5,6 +5,8 @@ import * as glmatrix from "gl-matrix";
5
5
  import { StepExternalByteStore } from "../../step/step_buffer_provider.js";
6
6
  import { IfcApiModelPassthrough } from "./ifc_api_model_passthrough.js";
7
7
  import { Properties } from "./properties.js";
8
+ import type { PreviewMeshPayload } from "./streamed_preview_channel.js";
9
+ export type { PreviewMeshPayload } from "./streamed_preview_channel.js";
8
10
  export * from "./ifc2x4.js";
9
11
  export declare const UNKNOWN = 0;
10
12
  export declare const STRING = 1;
@@ -47,6 +49,17 @@ export interface Loadersettings {
47
49
  * classic open paths and by the internal streamed→classic fallback.
48
50
  */
49
51
  DEFER_GEOMETRY?: boolean;
52
+ /**
53
+ * Conway extension (OpenModelStreamed + DEFER_GEOMETRY only; demand/tiled
54
+ * rendering slice A2): receive PREVIEW mesh payloads while the parse is
55
+ * still running — self-contained (geometry copied out of the wasm heap),
56
+ * so they can be uploaded before the model exists. Preview quality:
57
+ * relationship records (voids, materials) live near the end of real IFC
58
+ * files, so previews can miss openings/materials; the durable batch pump
59
+ * re-extracts every product after the parse and REPLACES the preview.
60
+ * Consumers must treat these as disposable. Ignored everywhere else.
61
+ */
62
+ ON_PREVIEW_MESH?: (mesh: PreviewMeshPayload) => void;
50
63
  }
51
64
  /**
52
65
  * web-ifc compatible log levels (numeric values match web-ifc's enum so an
@@ -1 +1 @@
1
- {"version":3,"file":"ifc_api.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,IAAI,mBAAmB,EAEjE,MAAM,aAAa,CAAA;AAGrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,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AAK,CAAC,MAAM,CAAC,EACpB,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IASjD;;;;;OAKG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAQrC;;;;;OAKG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;IAsElD;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ;IA6CzD;;;;;OAKG;IACH,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAyBtD;;;;OAIG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,UAAQ;IAM1C,sDAAsD;IACtD,gBAAgB,IAAI,MAAM;IAI1B,2FAA2F;IAC3F,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG;CAGpC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ifc_api_preview_channel.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ifc_api_preview_channel.test.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api_preview_channel.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,185 @@
1
+ /* eslint-disable no-magic-numbers */
2
+ // Parse-time preview channel (demand/tiled rendering slice A2): prefix
3
+ // snapshots of the live columnar sink must be exact prefixes of the final
4
+ // columns, and a full drain of the channel (prefix == whole file) must
5
+ // reproduce the classic StreamAllMeshes instance set — same entities,
6
+ // same geometry ids, same placed transforms — since the durable pump the
7
+ // preview hands over to is already pinned to classic parity.
8
+ import * as fs from "fs";
9
+ import { beforeAll, describe, expect, test } from "@jest/globals";
10
+ import { ConwayGeometry } from "../../../dependencies/conway-geom/index.js";
11
+ import IfcStepParser from "../../ifc/ifc_step_parser.js";
12
+ import { BufferByteSource } from "../../step/parsing/byte_source.js";
13
+ import { ColumnarIndexSink, } from "../../step/parsing/columnar_index.js";
14
+ import { ParseResult } from "../../step/parsing/step_parser.js";
15
+ import { buildIndexStreaming } from "../../step/parsing/streaming_index_builder.js";
16
+ import { IfcAPI } from "./ifc_api.js";
17
+ import { StreamedPreviewChannel, } from "./streamed_preview_channel.js";
18
+ const SETTINGS = { COORDINATE_TO_ORIGIN: true, USE_FAST_BOOLS: true };
19
+ const POOL = 1024 * 1024;
20
+ let api;
21
+ let conwayGeometry;
22
+ let data;
23
+ /**
24
+ * Parse index.ifc's data block into a fresh columnar sink.
25
+ *
26
+ * @param wrap Optional sink wrapper (snapshot triggers).
27
+ * @return {ColumnarIndexSink} The filled sink.
28
+ */
29
+ function buildSink(wrap) {
30
+ const sink = new ColumnarIndexSink();
31
+ const { result } = buildIndexStreaming(new BufferByteSource(data), IfcStepParser.Instance, POOL, void 0, wrap !== void 0 ? wrap(sink) : sink);
32
+ expect(result).toBe(ParseResult.COMPLETE);
33
+ return sink;
34
+ }
35
+ /**
36
+ * Classic reference: expressID -> list of placed instances.
37
+ *
38
+ * @param modelID An open classic model.
39
+ * @return {Map} expressID -> {geometryExpressID, flatTransformation}[].
40
+ */
41
+ function classicInstances(modelID) {
42
+ const instances = new Map();
43
+ api.StreamAllMeshes(modelID, (mesh) => {
44
+ const list = instances.get(mesh.expressID) ?? [];
45
+ for (let where = 0; where < mesh.geometries.size(); ++where) {
46
+ const placed = mesh.geometries.get(where);
47
+ list.push({
48
+ geometryExpressID: placed.geometryExpressID,
49
+ flatTransformation: [...placed.flatTransformation],
50
+ });
51
+ }
52
+ instances.set(mesh.expressID, list);
53
+ });
54
+ return instances;
55
+ }
56
+ beforeAll(async () => {
57
+ api = new IfcAPI();
58
+ await api.Init();
59
+ conwayGeometry = new ConwayGeometry();
60
+ expect(await conwayGeometry.initialize()).toBe(true);
61
+ data = new Uint8Array(fs.readFileSync("data/index.ifc"));
62
+ }, 120000);
63
+ describe("ColumnarIndexSink.snapshot", () => {
64
+ test("a mid-parse snapshot is an exact prefix of the final columns", () => {
65
+ const snapshotAt = 50;
66
+ let snapshot;
67
+ const sink = buildSink((inner) => ({
68
+ pushTopLevel: (entry) => {
69
+ inner.pushTopLevel(entry);
70
+ if (inner.topLevelCount === snapshotAt) {
71
+ snapshot = inner.snapshot();
72
+ }
73
+ },
74
+ reset: () => inner.reset(),
75
+ }));
76
+ const full = sink.finalize();
77
+ expect(snapshot).toBeDefined();
78
+ expect(snapshot.firstInlineElement).toBe(snapshotAt);
79
+ expect(full.firstInlineElement).toBeGreaterThan(snapshotAt);
80
+ for (let where = 0; where < snapshotAt; ++where) {
81
+ expect(snapshot.address[where]).toBe(full.address[where]);
82
+ expect(snapshot.length[where]).toBe(full.length[where]);
83
+ expect(snapshot.typeID[where]).toBe(full.typeID[where]);
84
+ expect(snapshot.expressID[where]).toBe(full.expressID[where]);
85
+ }
86
+ });
87
+ test("snapshotting does not disturb the sink (finalize sees everything)", () => {
88
+ const undisturbed = buildSink().finalize();
89
+ const snapshotted = buildSink((inner) => ({
90
+ pushTopLevel: (entry) => {
91
+ inner.pushTopLevel(entry);
92
+ // Snapshot aggressively — every 25 records.
93
+ if (inner.topLevelCount % 25 === 0) {
94
+ inner.snapshot();
95
+ }
96
+ },
97
+ reset: () => inner.reset(),
98
+ })).finalize();
99
+ expect(snapshotted.count).toBe(undisturbed.count);
100
+ expect(snapshotted.firstInlineElement).toBe(undisturbed.firstInlineElement);
101
+ expect([...snapshotted.address]).toEqual([...undisturbed.address]);
102
+ expect([...snapshotted.expressID]).toEqual([...undisturbed.expressID]);
103
+ });
104
+ });
105
+ describe("StreamedPreviewChannel", () => {
106
+ test("a full drain reproduces the classic instance set exactly", async () => {
107
+ const classicID = api.OpenModel(data, SETTINGS);
108
+ const classic = classicInstances(classicID);
109
+ let classicTotal = 0;
110
+ for (const list of classic.values()) {
111
+ classicTotal += list.length;
112
+ }
113
+ expect(classicTotal).toBeGreaterThan(0);
114
+ // Channel over a finished sink: the "prefix" is the whole file, so a
115
+ // drain must be a complete, classic-parity extraction.
116
+ const sink = buildSink();
117
+ const payloads = [];
118
+ const channel = new StreamedPreviewChannel(data, conwayGeometry, sink, true, (mesh) => payloads.push(mesh), void 0, void 0, 1);
119
+ channel.drainForTest();
120
+ expect(payloads.length).toBe(classicTotal);
121
+ // Every payload matches a classic instance of the same entity and
122
+ // geometry, with the same placed transform.
123
+ const unmatched = new Map();
124
+ for (const [expressID, list] of classic) {
125
+ unmatched.set(expressID, list.map((entry) => ({ ...entry })));
126
+ }
127
+ for (const payload of payloads) {
128
+ const candidates = unmatched.get(payload.expressID);
129
+ expect(candidates).toBeDefined();
130
+ const matchIndex = candidates.findIndex((candidate) => candidate.geometryExpressID === payload.geometryExpressID &&
131
+ candidate.flatTransformation.every((value, where) => Math.abs(value - payload.flatTransformation[where]) < 0.000001));
132
+ expect(matchIndex).toBeGreaterThanOrEqual(0);
133
+ candidates.splice(matchIndex, 1);
134
+ }
135
+ // Geometry payloads: exactly one carrier per distinct geometry, each
136
+ // carrying a sane interleaved buffer.
137
+ const carriers = payloads.filter((payload) => payload.vertexData !== void 0);
138
+ const distinctGeometry = new Set(payloads.map((p) => p.geometryExpressID));
139
+ expect(carriers.length).toBe(distinctGeometry.size);
140
+ for (const carrier of carriers) {
141
+ expect(carrier.vertexData.length % 6).toBe(0);
142
+ expect(carrier.vertexData.length).toBeGreaterThan(0);
143
+ expect(carrier.indexData.length % 3).toBe(0);
144
+ expect(carrier.indexData.length).toBeGreaterThan(0);
145
+ }
146
+ // The channel derived and pinned a coordination frame (proved
147
+ // equivalent to classic's by the transform parity above), and the
148
+ // deferred open must keep the classic GetCoordinationMatrix
149
+ // contract: identity, because placed transforms are premultiplied
150
+ // and consumers stamp the result onto assembled models — a
151
+ // non-identity return would coordinate twice.
152
+ expect(channel.coordinationMatrix).toBeDefined();
153
+ const deferredID = await api.OpenModelStreamed(data, { ...SETTINGS, DEFER_GEOMETRY: true });
154
+ api.StreamAllMeshes(deferredID, () => { });
155
+ const classicCoordination = api.GetCoordinationMatrix(classicID);
156
+ const deferredCoordination = api.GetCoordinationMatrix(deferredID);
157
+ expect(deferredCoordination).toEqual(classicCoordination);
158
+ api.CloseModel(classicID);
159
+ api.CloseModel(deferredID);
160
+ }, 240000);
161
+ test("ON_PREVIEW_MESH on a deferred streamed open never breaks the durable path", async () => {
162
+ const classicID = api.OpenModel(data, SETTINGS);
163
+ const classic = classicInstances(classicID);
164
+ const payloads = [];
165
+ const deferredID = await api.OpenModelStreamed(data, {
166
+ ...SETTINGS,
167
+ DEFER_GEOMETRY: true,
168
+ ON_PREVIEW_MESH: (mesh) => payloads.push(mesh),
169
+ });
170
+ expect(deferredID).toBeGreaterThanOrEqual(0);
171
+ // index.ifc parses inside one cooperative slice, so the timer-driven
172
+ // channel usually never fires — the contract here is that its presence
173
+ // changes nothing about the durable pump's output.
174
+ const drained = new Map();
175
+ api.StreamAllMeshes(deferredID, (mesh) => {
176
+ drained.set(mesh.expressID, (drained.get(mesh.expressID) ?? 0) + mesh.geometries.size());
177
+ });
178
+ expect(drained.size).toBe(classic.size);
179
+ for (const [expressID, list] of classic) {
180
+ expect(drained.get(expressID)).toBe(list.length);
181
+ }
182
+ api.CloseModel(classicID);
183
+ api.CloseModel(deferredID);
184
+ }, 240000);
185
+ });
@@ -20,6 +20,9 @@ interface IfcProxyLoadState {
20
20
  conwaywasm: ConwayGeometry;
21
21
  /** True when opened without extraction (createDeferred). */
22
22
  deferred?: boolean;
23
+ /** Coordination matrix the parse-time preview channel derived (slice
24
+ * A2) — adopted by the durable capture so both share one frame. */
25
+ previewCoordinationMatrix?: glmatrix.mat4;
23
26
  allTimeStart: number;
24
27
  stepHeader: StepHeader;
25
28
  model: IfcStepModel;
@@ -68,6 +71,17 @@ export declare class IfcApiProxyIfc implements IfcApiModelPassthrough {
68
71
  private readonly demandCapturedCounts_;
69
72
  /** Cursor into demandProducts_ — products before it are extracted. */
70
73
  private demandCursor_;
74
+ /**
75
+ * Coordination matrix the deferred capture derived (or adopted from
76
+ * the parse-time preview channel). Kept OFF the model tuple's slot 5
77
+ * deliberately: classic streamAllMeshes derives its coordination into
78
+ * a local and getCoordinationMatrix therefore returns identity —
79
+ * consumers (Share) stamp that result onto the assembled model, so a
80
+ * deferred open must present the same identity or coordination would
81
+ * apply twice. This field is only the pump's internal multi-call
82
+ * memory.
83
+ */
84
+ private demandCoordination_?;
71
85
  _isCoordinated: boolean;
72
86
  linearScalingFactor: number;
73
87
  identity: number[];
@@ -412,9 +426,11 @@ export declare class IfcApiProxyIfc implements IfcApiModelPassthrough {
412
426
  * entity's FULL vector, so getFlatMesh stays whole-model correct).
413
427
  *
414
428
  * Also fixes a latent multi-call bug: the derived coordination
415
- * matrix is stored back to the model tuple, so later batches place
429
+ * matrix is remembered (demandCoordination_), so later batches place
416
430
  * with the SAME coordination the first batch established
417
- * (streamAllMeshes never needed this — it runs once).
431
+ * (streamAllMeshes never needed this — it runs once). It is NOT
432
+ * exposed through getCoordinationMatrix, which keeps the classic
433
+ * identity contract consumers stamp onto assembled models.
418
434
  *
419
435
  * @param meshCallback Receives one delta FlatMesh per entity that
420
436
  * gained instances this call.
@@ -1 +1 @@
1
- {"version":3,"file":"ifc_api_proxy_ifc.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api_proxy_ifc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACf,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,YAAY,MAAM,0BAA0B,CAAA;AACnD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,WAAW,EACX,cAAc,EACd,cAAc,EACd,WAAW,EACX,MAAM,EACP,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAC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EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAC/E,YAAY,GAAG,WAAW;IAK5B;;;;OAIG;IACH,UAAU;IAIV;;;;;;;;;;;;;;;;;OAiBG;IACH,oBAAoB,CAChB,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,GAAI;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAC;IA6CrF;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,gBAAgB;IA8KxB;;;;OAIG;IACH,eAAe,CAAE,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI;IAmPvD;;;;;OAKG;IACH,wBAAwB,CACpB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI;IA+O1C;;;;OAIG;IACH,eAAe,IAAI,MAAM,CAAC,QAAQ,CAAC;IA0RnC;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ;IAqDxC;;;;;OAKG;IACH,4BAA4B,IAAI,IAAI;CAwBrC"}
@@ -9,7 +9,9 @@ import { extractModelInfo } from "../../loaders/loading_utilities.js";
9
9
  import IfcStepParser from "../../ifc/ifc_step_parser.js";
10
10
  import ParsingBuffer from "../../parsing/parsing_buffer.js";
11
11
  import { BufferByteSource } from "../../step/parsing/byte_source.js";
12
- import { buildColumnarIndexStreamingAsync, } from "../../step/parsing/streaming_index_builder.js";
12
+ import { buildIndexStreamingAsync, } from "../../step/parsing/streaming_index_builder.js";
13
+ import { ColumnarIndexSink } from "../../step/parsing/columnar_index.js";
14
+ import { StreamedPreviewChannel } from "./streamed_preview_channel.js";
13
15
  import { ExtractResult } from "../../index.js";
14
16
  import { IfcGeometryExtraction } from "../../ifc/ifc_geometry_extraction.js";
15
17
  import { ParseResult } from "../../index.js";
@@ -150,6 +152,15 @@ export class IfcApiProxyIfc {
150
152
  ];
151
153
  // save settings
152
154
  this.settings = settings;
155
+ // Deferred opens whose preview channel already established the
156
+ // coordination frame: adopt it, so the durable capture skips its own
157
+ // derivation and places exactly where the preview did. (Internal
158
+ // only — getCoordinationMatrix stays identity, see
159
+ // demandCoordination_.)
160
+ if (this.deferredMode_ && loadState.previewCoordinationMatrix !== void 0) {
161
+ this.demandCoordination_ = loadState.previewCoordinationMatrix;
162
+ this._isCoordinated = true;
163
+ }
153
164
  let FILE_NAME = stepHeader.headers.get("FILE_NAME");
154
165
  if (FILE_NAME !== void 0) {
155
166
  // strip start / end parenthesis
@@ -451,7 +462,21 @@ export class IfcApiProxyIfc {
451
462
  const parseTick = tracker !== void 0 ?
452
463
  (cursorBytes) => tracker.update(cursorBytes) : void 0;
453
464
  const parseStartTime = Date.now();
454
- const { columns, result } = await buildColumnarIndexStreamingAsync(new BufferByteSource(data), parser, STREAMED_PARSE_POOL_BYTES, void 0, parseTick);
465
+ // Inline twin of buildColumnarIndexStreamingAsync the sink is created
466
+ // here so the parse-time preview channel (slice A2) can watch it grow
467
+ // and snapshot prefix models between the parse's cooperative yields.
468
+ const sink = new ColumnarIndexSink();
469
+ const previewChannel = deferGeometry && settings?.ON_PREVIEW_MESH !== void 0 ?
470
+ new StreamedPreviewChannel(data, conwaywasm, sink, settings.COORDINATE_TO_ORIGIN === true, settings.ON_PREVIEW_MESH) : void 0;
471
+ previewChannel?.start();
472
+ let result;
473
+ try {
474
+ ({ result } = await buildIndexStreamingAsync(new BufferByteSource(data), parser, STREAMED_PARSE_POOL_BYTES, void 0, sink, parseTick));
475
+ }
476
+ finally {
477
+ previewChannel?.stop();
478
+ }
479
+ const columns = sink.finalize();
455
480
  const parseEndTime = Date.now();
456
481
  tracker?.endPhase(data.length);
457
482
  if (result !== ParseResult.COMPLETE) {
@@ -472,6 +497,10 @@ export class IfcApiProxyIfc {
472
497
  return {
473
498
  conwaywasm,
474
499
  deferred: true,
500
+ // Pin the durable pump's coordination to the preview channel's
501
+ // (derived from the same first instance with the same math), so
502
+ // preview payloads and durable meshes share one frame.
503
+ previewCoordinationMatrix: previewChannel?.coordinationMatrix,
475
504
  allTimeStart,
476
505
  stepHeader,
477
506
  model,
@@ -1028,16 +1057,18 @@ export class IfcApiProxyIfc {
1028
1057
  * entity's FULL vector, so getFlatMesh stays whole-model correct).
1029
1058
  *
1030
1059
  * Also fixes a latent multi-call bug: the derived coordination
1031
- * matrix is stored back to the model tuple, so later batches place
1060
+ * matrix is remembered (demandCoordination_), so later batches place
1032
1061
  * with the SAME coordination the first batch established
1033
- * (streamAllMeshes never needed this — it runs once).
1062
+ * (streamAllMeshes never needed this — it runs once). It is NOT
1063
+ * exposed through getCoordinationMatrix, which keeps the classic
1064
+ * identity contract consumers stamp onto assembled models.
1034
1065
  *
1035
1066
  * @param meshCallback Receives one delta FlatMesh per entity that
1036
1067
  * gained instances this call.
1037
1068
  */
1038
1069
  streamNewMeshes_(meshCallback) {
1039
1070
  const [model, scene, meshMap, geometryMaterialTransformMap] = this.model;
1040
- let coordinationMatrix = this.model[5];
1071
+ let coordinationMatrix = this.demandCoordination_ ?? glmatrix.mat4.create();
1041
1072
  const seenThisPass = new Map();
1042
1073
  const deltas = new Map();
1043
1074
  // eslint-disable-next-line no-unused-vars
@@ -1096,8 +1127,9 @@ export class IfcApiProxyIfc {
1096
1127
  glmatrix.mat4.scale(scaleMatrix, scaleMatrix, scaleVec);
1097
1128
  glmatrix.mat4.multiply(coordinationMatrix, this.NormalizeMat, coordinationMatrix);
1098
1129
  glmatrix.mat4.multiply(coordinationMatrix, scaleMatrix, coordinationMatrix);
1099
- // Persist for every later batch (and getCoordinationMatrix).
1100
- this.model[5] = coordinationMatrix;
1130
+ // Persist for every later batch (internal only — see
1131
+ // demandCoordination_'s identity-contract note).
1132
+ this.demandCoordination_ = coordinationMatrix;
1101
1133
  this._isCoordinated = true;
1102
1134
  }
1103
1135
  const newTransform = glmatrix.mat4.create();