10 Commits
Author SHA1 Message Date
Hakan SevenandClaude Opus 4.7 66fca6e591 docs(rendering): mark Phase 4 done, drop deferred / non-goal phases
Phase 4-B (batched hatch pipeline) is in; Phase 4.1 (multi-draw
indirect / GPU compute cull) stays as a deliberate non-goal because
iced 0.14 doesn't expose the required wgpu features to widget
pipelines, and the single-draw batched path already collapses N
bind-group swaps + N draw calls into one. Phase 4.2 (Hi-Z occlusion)
only matters for perspective 3D, which H7CAD doesn't ship.

The doc is now a short stub — the per-phase rationale lives at the
call sites (search for "Phase N.X" comments).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-17 20:18:55 +03:00
Hakan SevenandClaude Opus 4.7 38f9733eb1 docs(rendering): drop completed Phase 2
Phase 2.1/2.2/2.3 landed across the previous commits:
- 727992b quadtree primitive
- 3e87460 Scene::entity_index lazy build
- e43498d wire tessellation uses query_rect
- fcf4d4f mesh draw-time frustum cull
- b70c9f9 hatch + wipeout draw-time frustum cull

What was skipped on purpose:
- Octree-with-Aabb3: meshes only carry XY world_aabb today; the
  pragmatic adaptation is a 4-corner projection test in
  `compute_mesh_lod`. Revisit if a true 3D viewport mode lands.
- Per-mutation incremental quadtree updates: `entity_index_cache` is
  geometry_epoch-keyed and rebuilds lazily on next query. Full
  rebuild is ~50 ms on a 100 k-entity doc — acceptable for occasional
  edits; promote to incremental updates if profiling shows the
  rebuild cost.

Phase 4 (GPU-side culling) remains the next big lever.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-17 15:03:33 +03:00
Hakan SevenandClaude Opus 4.7 15bddb2f58 chore(scene): drop INSERT_SUB_LIMIT guard from fallback explode path
The 5,000 sub-entity guard was added when an xref block with ~74k subs
froze the UI on first render. The block_cache primary path (def72e4)
made that path unreachable for typical Inserts — the guard now only
gated the rare legacy-explode fallback, where it hid otherwise-renderable
geometry as an insertion marker.

Remove the constant and its early-return; the fallback path now matches
the primary path's "render everything" behaviour. Also drop the
RENDERING_OPTIMIZATION.md "TEMPORARY" section that tracked this guard.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-15 23:53:26 +03:00
Hakan SevenandClaude Opus 4.7 41cf2ffe11 docs(rendering): drop completed roadmap phases (1.4 / 3.3 / 3.4)
Phase 1.4 (hatch/image scissor), Phase 3.3 (hatch LOD), and Phase 3.4
(mesh LOD) landed in commits fbbac42, e7675be, and 8c08ae1. Removed
their roadmap sections and pruned the Implementation Order / Key Files
/ Success Metrics tables to reflect what's still outstanding (Phase 2
spatial index, Phase 4 GPU compute cull + Hi-Z).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-15 23:34:42 +03:00
HakanandClaude Opus 4.7 26271b8c63 perf(scene): zoom-adaptive curve tolerance for top-level wires (Phase 3.2)
Edge tessellation used a fixed 0.005 world-unit chord-height tolerance
regardless of zoom — a 1000 m radius arc viewed at 50 mm/px still emitted
hundreds of segments that all collapsed onto the same screen pixel.

`truck_tess` now reads tolerance from a process-wide AtomicU64 override.
`Scene::wires_for_block` sets the override to ~0.5 px chord height
(world_per_pixel × 0.5) before the par_iter, then a Drop guard clears it
back to the default. Floor stays at the original CURVE_TOL so extreme
zoom-in keeps full quality. Block-cache rebuilds and off-render paths
(snap, hit-test) always see the default — the override is bracketed to
the render call only.

Roadmap entry for Phase 3.2 removed; Implementation Order / Key Files
tables updated.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-15 14:07:28 +03:00
HakanandClaude Opus 4.7 5344d0d6d6 docs(rendering): drop completed roadmap phases
Phase 1.1 (entity AABB), 1.2 (ViewVolume), 1.3 (CPU cull), 3.1 (sub-pixel
cull), and 3.5 (text simplification) are all live in tree — remove them
from the roadmap. Implementation Order and Key Files tables trimmed to
the still-pending work. TEMPORARY Insert sub-entity guard section now
notes which "proper fix" already landed (per-block cache, def72e4) and
which is still open.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-15 13:19:35 +03:00
Hakan SevenandClaude Opus 4.7 c61d648dc7 fix(scene): unfreeze open on huge xref Inserts
A real DWG with an xref containing ~74k sub-entities froze on the first
render: Insert tessellation exploded the block, style-resolved every sub
serially, and one bad sub could hang the loop forever.

- Insert short-circuits to an insertion marker when the referenced block
  has more than INSERT_SUB_LIMIT (5_000) sub-entities. Documented as
  temporary in RENDERING_OPTIMIZATION.md.
- Re-run purge_corrupt_entities after resolve_xrefs so parser-garbage
  inside xref content is caught (initial purge runs before xref load).
- build_derived_caches: single pass over entities collecting handles
  per kind; tessellation reads via doc.get_entity instead of cloning
  every EntityType. Image decode now parallel too.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-13 23:02:48 +03:00
HakanandClaude Opus 4.7 9b6d5437fa revert: drop wire segment caps that silently truncated geometry
Remove MAX_SEGS_PER_WIRE = 100_000 and MAX_TOTAL_SEGS = 3_000_000.
These were stop-gap GPU-memory guards that mutated visible output:
single complex entities were cut mid-geometry, and entire wires past
the 3M total were dropped by arrival order with no spatial awareness.
Either is worse than honestly drawing whatever the file contains —
truncated arcs and missing road segments look like bugs to the user,
not "we ran out of GPU memory."

The matching "Temporary Workarounds" section in
RENDERING_OPTIMIZATION.md goes with them. Per-entity LOD and
viewport culling (Phase 1 + 3.2 in the same doc) remain the right
long-term answer; until they land, prefer correctness over a soft
crash on pathological files.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-13 10:11:54 +03:00
HakanandClaude Sonnet 4.6 5e85698dee docs: document temporary wire segment caps in rendering optimization notes
Explains the stop-gap MAX_SEGS_PER_WIRE / MAX_TOTAL_SEGS limits added in
321433e, why they must be reverted, and the condition under which they
should be removed (Phase 1.3 CPU cull landed and verified).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-05-07 17:26:15 +03:00
HakanandClaude Sonnet 4.6 8e154e2e9e docs: add rendering optimization roadmap for LOD and frustum culling
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-05-07 16:05:31 +03:00