Title: remove_deep2 regression: deleting large tessellations freezes again · Issue #10117 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: remove_deep2 regression: deleting large tessellations freezes again · Issue #10117 · IfcOpenShell/IfcOpenShell
X Title: remove_deep2 regression: deleting large tessellations freezes again · Issue #10117 · IfcOpenShell/IfcOpenShell
Description: Since #9502 (and its follow-ups b8a7b33 and f2b0546), ifcopenshell.util.element.remove_deep2 no longer applies the #3052 guard. Before deleting a subgraph, that guard emptied large list attributes (such as IfcPolygonalFaceSet.Faces) on e...
Open Graph Description: Since #9502 (and its follow-ups b8a7b33 and f2b0546), ifcopenshell.util.element.remove_deep2 no longer applies the #3052 guard. Before deleting a subgraph, that guard emptied large list attributes ...
X Description: Since #9502 (and its follow-ups b8a7b33 and f2b0546), ifcopenshell.util.element.remove_deep2 no longer applies the #3052 guard. Before deleting a subgraph, that guard emptied large list attributes ...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/10117
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"remove_deep2 regression: deleting large tessellations freezes again","articleBody":"Since #9502 (and its follow-ups b8a7b33f2a and f2b0546a51), `ifcopenshell.util.element.remove_deep2` no longer applies the #3052 guard. Before deleting a subgraph, that guard emptied large list attributes (such as `IfcPolygonalFaceSet.Faces`) on elements that were about to be deleted anyway.\n\nWithout it, each `IfcIndexedPolygonalFace` is removed while its face set still lists it. Inside a transaction (every Bonsai operator), `Transaction.store_delete` → `get_element_inverses` then re-serialises the whole `Faces` list once per face, so deleting a large tessellation takes time quadratic in its face count.\n\n### Repro\n\nIn Bonsai, `bim.unlink_object` (or delete) on an `IfcGeographicElement` `.TERRAIN.` with 4 `IfcPolygonalFaceSet`s totalling about 30,000 faces (the largest holds 22,906). Blender freezes. Stack dumps taken every 15 s all sit in:\n\n`delete_ifc_object` → `root.remove_product` → `geometry.remove_representation` → `remove_deep2` → `file.remove` → `Transaction.store_delete` → `get_element_inverses`\n\n### Measurements\n\n- Removing 300 faces one by one inside a transaction, while the face set still references them: **26.3 s** (about 88 ms per face), so tens of minutes for the whole mesh.\n- The same after emptying `Faces` first: **2,000 faces in 0.28 s**.\n- `bim.unlink_object` on the terrain with the guard restored: **3.2 s** in total.\n\n### Related\n\n- #3052: the original report of this freeze, which the guard fixed.\n- #9502: the rewrite that dropped the guard.\n- #9602 (open) speeds up the C++ side of removing an instance from an aggregate, but it does not touch the Python transaction's `get_element_inverses`, which is where the time goes here. Its description also still assumes `remove_deep2`'s \"clear lists longer than 10\" workaround is in place.\n\n### Fix\n\nRestore the #3052 loop in `remove_deep2` just before `ifc_file.batch()`. A PR with a regression test (including undo) follows.\n\n*Investigated and written with the assistance of an AI coding tool (Claude Code), and tested by a human in Bonsai.*\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-11-02T23:34:53Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/10117"}
| 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:406220f4-c62c-9f7a-3ae3-f5a7418e3388 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8EE0:81334:2583DF:347F10:6B04740D |
| html-safe-nonce | b094986dbf46e81c4ee2eb64ed2fd9e45bda0bb0dbbbd459291675df4d1b8499 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUUwOjgxMzM0OjI1ODNERjozNDdGMTA6NkIwNDc0MEQiLCJ2aXNpdG9yX2lkIjoiNjY3MzIyNTAzMTg3MjcwNTU0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 364478c2417e7a9bfa248d1e90fbef37cb7f80b5fa50afd4f6e63fa4bb797427 |
| hovercard-subject-tag | issue:6173035712 |
| 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/10117/issue_layout |
| twitter:image | https://opengraph.githubassets.com/354e72b91e847eca4396aec7744c9450ec9af6f6cb3f0b90079023159255d364/IfcOpenShell/IfcOpenShell/issues/10117 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/354e72b91e847eca4396aec7744c9450ec9af6f6cb3f0b90079023159255d364/IfcOpenShell/IfcOpenShell/issues/10117 |
| og:image:alt | Since #9502 (and its follow-ups b8a7b33 and f2b0546), ifcopenshell.util.element.remove_deep2 no longer applies the #3052 guard. Before deleting a subgraph, that guard emptied large list attributes ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | theoryshaw |
| hostname | github.com |
| expected-hostname | github.com |
| None | ae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f |
| 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 | cfb5f24c6e01d85f70804652a5107e5cac03a161 |
| 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