nigig-org/crates/apps
andodeki 4cbb155cb7
Some checks failed
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
perf(cad): stroke per group, not per item -- Phase 4 of the render plan
A 2,000-part plan view with everything on screen cost 2,270 tessellation
calls a frame. It now costs four: two for the grid, two for the parts.

`stroke()` tessellates the whole accumulated path and clears it --
`tessellate_path_stroke` ends in `path.clear()` -- so queueing many
subpaths and stroking once is one tessellation instead of N. The idiom
was already in this file: `queue_dashed_line` has done it for the axis
grid since Phase 3.9, guarded by a test. Phase 4 applies it to the two
loops that never adopted it.

**Base grid: two passes, two strokes.** Minors queued and stroked at
0.55, majors at 1.6 -- the stroke width is the one thing that genuinely
needs its own call. `GridRange::has_minor_lines`/`has_major_lines`
decide whether a pass runs at all and `frame_budget` counts strokes with
the same two predicates, because an empty `stroke()` still enters the
tessellator and a budget that assumed two when the renderer made one
would be wrong in the direction that hides work. Minors stroke first so
majors land on top where they cross; same colour either way, so the only
visible difference is that the thicker line wins a crossing, which is
the right answer.

**Parts grouped by colour.** New `batching::ColorKey` -- the bit pattern,
because `f32` is not `Hash` and two colours whose bits differ are two
colours -- feeding the same `group_in_first_appearance_order` that
Phase 3 groups shapes with. The colour policy moved out of the two draw
loops into `constants::part_outline_color`, so the renderer and
`frame_budget` cannot disagree about how many groups a frame has; the 2D
loop had `vec4(1.0, 0.82, 0.40, 1.0)` written out where
`PART_SELECT_COLOR` already existed.

**Selected and hovered parts stroke last**, in their own groups, so a
highlight is never hidden under a neighbour's outline. They were
interleaved in document order before and could be.

`FrameBudget` gained `grid_lines` and `part_outlines` beside the call
counts. Geometry volume and call count are different numbers now and
both are worth reading -- `VectorSubmission { outlines, stroke_calls }`
mirrors Phase 3's `MeshSubmission` for the same reason.

Measured (bench_frame_submission_budget, 1920x1080, 200 m site):

  zoom   5 m, 2000 parts:   12 visible outlines ->  4 tessellations (was 2170)
  zoom 200 m, 2000 parts: 2000 visible outlines ->  4 tessellations (was 2270)

The second row is the point, and it is the row Phase 1 could not move:
everything is on screen, culling removes nothing, and the frame still
costs four calls.

WHAT THIS DOES NOT DO: vertex volume is unchanged. The same 2,000
rectangles are tessellated -- in two calls rather than 2,000. What is
saved is per-call overhead: tessellator setup, two `std::mem::take`s and
an `append_geometry` each time. If a 2,000-part plan view is still slow
after this, the remaining cost is triangles, which is Phase 5 and should
only happen if a measurement asks for it.

One visible-behaviour caveat, stated rather than buried: parts of the
same colour are now drawn together, so where two outlines of *different*
colours overlap, which is on top can change. They are 1.8 px outlines
and the highlight ordering got strictly better, but it is a change to
what is drawn, not only to how.

Two tests were wrong before the code was, which is becoming this plan's
pattern. `constants.rs` fell to 81.82% and the coverage floor caught it
-- `part_outline_color` had no tests, and it now has five. And the guard
test's first draft looked for a closing brace at a fixed indentation,
matched the wrong one, and failed on correct code; it matches braces
properly now.

Verified: tools/test-cad-coverage.sh green -- total 97.33%, batching.rs
100%, cull.rs 100%, render_budget.rs 99.68%, constants.rs 98.55%, all
floors met; cargo check --locked -p nigig-build --lib clean; cargo test
--lib 1114 passed (1100 + 14 new); --test cad_integration 154 passed;
CAD_BENCH=1 harness green; cargo fmt --check and git diff --check clean.
2026-08-21 05:08:14 +00:00
..
doc/doc-engine test(doc-engine): isolated source-coverage harness with floors 2026-08-17 04:33:08 +00:00
geohot build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
makepad_table feat(makepad-table): opt-in capabilities feature, and raise the matrix_client defect 2026-08-18 18:03:26 +00:00
map fix(map): NigigMapView packed vertex shader for new DrawVector; fix pay sheet visible 2026-08-17 04:51:07 +00:00
nigig-ai build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-alerts build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-book build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-build perf(cad): stroke per group, not per item -- Phase 4 of the render plan 2026-08-21 05:08:14 +00:00
nigig-chat build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-delivery build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-email feat(email): email the trip report to the finance department 2026-08-18 10:07:54 +00:00
nigig-feed build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-garage build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-health build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-insure build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-marikiti build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-mobility build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-mpesa fix(mpesa): parse SMS from in-memory messages, not serde-skipped cache 2026-08-17 15:13:33 +03:00
nigig-pay fix(mpesa): parse SMS from in-memory messages, not serde-skipped cache 2026-08-17 15:13:33 +03:00
nigig-pay-ui fix(pay): the M-Pesa PIN field has been visible by default since 69f6fb2 2026-08-18 07:05:04 +00:00
nigig-property build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-rider build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-shop build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-sms build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-tow build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-vehicle build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig-walkie build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
nigig_doc_scanner build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
pdf feat(pdf): Unicode-aware search and layout-aware reading order 2026-08-19 16:12:12 +00:00
spreadsheet feat(spreadsheet): dropdown cells and button cells (#9 remainder, complete) 2026-08-21 04:52:00 +00:00
streem build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
theming build: pin every git dependency to a full 40-character SHA (Phase 0.2) 2026-08-16 18:35:39 +00:00
valhalla feat(valhalla): implement phase B 2d line segment intersection, ellipse containment, and oriented bounding box obb2 overlap math 2026-07-28 17:50:06 +00:00