Title: 0.9.0 SPF files: by_guid misses charset-legal but invalid-base64 GlobalIds that 0.8.5 matched verbatim · Issue #9830 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: 0.9.0 SPF files: by_guid misses charset-legal but invalid-base64 GlobalIds that 0.8.5 matched verbatim · Issue #9830 · IfcOpenShell/IfcOpenShell
X Title: 0.9.0 SPF files: by_guid misses charset-legal but invalid-base64 GlobalIds that 0.8.5 matched verbatim · Issue #9830 · IfcOpenShell/IfcOpenShell
Description: Version: ifcopenshell 0.9.0 (PyPI wheel, Linux x86_64, Python 3.12) — behavior regression vs 0.8.5 Summary On a regular (in-memory SPF) file, file.by_guid on 0.9.0 raises RuntimeError: Instance with GlobalId '...' not found for GlobalId ...
Open Graph Description: Version: ifcopenshell 0.9.0 (PyPI wheel, Linux x86_64, Python 3.12) — behavior regression vs 0.8.5 Summary On a regular (in-memory SPF) file, file.by_guid on 0.9.0 raises RuntimeError: Instance wit...
X Description: Version: ifcopenshell 0.9.0 (PyPI wheel, Linux x86_64, Python 3.12) — behavior regression vs 0.8.5 Summary On a regular (in-memory SPF) file, file.by_guid on 0.9.0 raises RuntimeError: Instance wit...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9830
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"0.9.0 SPF files: by_guid misses charset-legal but invalid-base64 GlobalIds that 0.8.5 matched verbatim","articleBody":"**Version:** ifcopenshell 0.9.0 (PyPI wheel, Linux x86_64, Python 3.12) — behavior regression vs 0.8.5\n\n## Summary\n\nOn a regular (in-memory SPF) file, `file.by_guid` on 0.9.0 raises `RuntimeError: Instance with GlobalId '...' not found` for GlobalId attribute values that are 22-character strings over the IfcGloballyUniqueId alphabet but are **not valid base64 encodings** — even though the entity is present in the file with exactly that GlobalId. 0.8.5's `by_guid` matched such strings verbatim, so models or test fixtures carrying pseudo-GUIDs resolve on 0.8.5 and stop resolving on 0.9.0.\n\n## Reproduction\n\n```python\nimport ifcopenshell, ifcopenshell.guid\n\nSYN = \"0SYNTH000000156\" # 22 chars, all in the IfcGloballyUniqueId alphabet; invalid base64 (17 data chars)\n\nf = ifcopenshell.file(schema=\"IFC4\")\nf.create_entity(\"IfcWall\", GlobalId=SYN, Name=\"synthetic\")\nf.create_entity(\"IfcWall\", GlobalId=ifcopenshell.guid.new(), Name=\"canonical\")\nf.write(\"m.ifc\")\n\nm = ifcopenshell.open(\"m.ifc\")\nprint([(w.id(), w.GlobalId) for w in m.by_type(\"IfcWall\")]) # [(1, '0SYNTH000000156'), (2, ...)]\nprint(m.by_guid(SYN)) # 0.8.5: resolves #1 — 0.9.0: RuntimeError: ... not found\nprint(ifcopenshell.guid.expand(SYN)) # both: Error: Invalid base64-encoded string: number of data\n # characters (17) cannot be 1 more than a multiple of 4\n```\n\n## Observed (A/B on the wheels)\n\n- **0.8.5**: `by_guid('0SYNTH000000156')` → HIT (`#1`); canonical `guid.new()` values → HIT\n- **0.9.0**: `by_guid('0SYNTH000000156')` → MISS (`RuntimeError`); canonical values → HIT; `by_type` shows the entity present with that exact attribute value\n\n## Expected behavior\n\n`by_guid` resolves any string the file actually contains as a GlobalId attribute (raw-string index lookup), as 0.8.5 did — or, if canonicalization is intentional, the miss for charset-legal values is documented on the `by_guid` API.\n\n## Notes\n\n- Found during a 0.8.5 → 0.9.0 production upgrade of a model-checking pipeline (~3.4k-test corpus). The values occur in practice: deterministic human-readable fixture ids, and the same class would affect any exporter emitting non-canonical guid strings (charset-legal, encoding-invalid).\n- Presumably related to the new GlobalId hash-index lookup path (also behind #9822 / #9827): if the lookup canonicalizes the key through expand/compress, encoding-invalid strings become unindexable even though they round-trip through the file verbatim.\n- Our workaround (happy to share pattern): on a `by_guid` miss, fall back to a lazily built `GlobalId -> id` map from one `by_type(\"IfcRoot\")` pass — resolves raw strings on both SPF and RocksDB files.\n","author":{"url":"https://github.com/darellchua2","@type":"Person","name":"darellchua2"},"datePublished":"2026-10-06T12:05:49Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9830"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fd8d76d4-f7c4-57c6-5745-96a44ddd24e8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DE74:24C069:C1C64A:1080208:6B048BE0 |
| html-safe-nonce | 8bc4c68491f78e86e78b7b3e013babb33d7f39898095fef66f770c3354921ab1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTc0OjI0QzA2OTpDMUM2NEE6MTA4MDIwODo2QjA0OEJFMCIsInZpc2l0b3JfaWQiOiIzNDUwMDA1NTMxMTExMjMwNDMyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a56866db38b38c55bd064224ccc5c58e88fbd81409fd63a6bbe1975c5691e4e5 |
| hovercard-subject-tag | issue:5728060791 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/9830/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7f190827d3f9e00e109dddb0215b978a242a027b19d8e8c45ddded6cd9f02dbc/IfcOpenShell/IfcOpenShell/issues/9830 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7f190827d3f9e00e109dddb0215b978a242a027b19d8e8c45ddded6cd9f02dbc/IfcOpenShell/IfcOpenShell/issues/9830 |
| og:image:alt | Version: ifcopenshell 0.9.0 (PyPI wheel, Linux x86_64, Python 3.12) — behavior regression vs 0.8.5 Summary On a regular (in-memory SPF) file, file.by_guid on 0.9.0 raises RuntimeError: Instance wit... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | darellchua2 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b297275a74a2c9a35898175c9477837c635d4f579277ebff3b2d6ebd012e247 |
| turbo-cache-control | no-preview |
| go-import | github.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git |
| octolytics-dimension-user_id | 13692563 |
| octolytics-dimension-user_login | IfcOpenShell |
| octolytics-dimension-repository_id | 40473201 |
| octolytics-dimension-repository_nwo | IfcOpenShell/IfcOpenShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 40473201 |
| octolytics-dimension-repository_network_root_nwo | IfcOpenShell/IfcOpenShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b51ce57ca6d4565a42856fc1c9897077c794597f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width