nigig-org/REVIEWS
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
..
adr feat(pdf): Unicode-aware search and layout-aware reading order 2026-08-19 16:12:12 +00:00
docs docs(map): reconcile makepad fork with upstream dev 2026-08-16 2026-08-16 21:30:47 +00:00
CAD_COVERAGE_100_PLAN.md docs(cad): a phased plan to 100% coverage, written after measuring 2026-08-17 12:40:35 +00:00
CAD_DRAWCALL_STRATEGY_ANALYSIS.md docs(cad): merge a second render review into the plan, and correct the hash both reviews got wrong 2026-08-20 21:17:07 +00:00
CAD_RENDER_OPTIMISATION_PLAN.md perf(cad): stroke per group, not per item -- Phase 4 of the render plan 2026-08-21 05:08:14 +00:00
COST ESTIMATE REVIEW.md Initial commit 2026-07-26 19:38:26 +03:00
DART_PDF_VS_MAKEPAD_PDF_GAP_ANALYSIS.md Initial commit 2026-07-26 19:38:26 +03:00
IMPLEMENTATION_AUDIT.md feat(pay): USSD automation on by default; containment moves to packaging 2026-08-02 08:06:43 +00:00
MAP REVIEW.md Initial commit 2026-07-26 19:38:26 +03:00
MATRIX_CLIENT_FEATURE_GATE.md feat(makepad-table): opt-in capabilities feature, and raise the matrix_client defect 2026-08-18 18:03:26 +00:00
NIGIG_EMAIL_ASSESSMENT_AND_PLAN.md ci(email): raise the domain floor; record the finance-email path 2026-08-18 10:07:54 +00:00
NIGIG_PAY_CONSOLIDATED_REVIEW.md Initial commit 2026-07-26 19:38:26 +03:00
PAY_CAD_IMPLEMENTATION_STATUS.md docs(cad): the widget layer was never unbuildable — I never tried 2026-08-17 11:55:25 +00:00
PDF_DRAWCALL_STRATEGY_ANALYSIS.md docs(pdf): does the PDF viewport have a minimal-drawcall strategy? No -- and the renderer is unwired 2026-08-21 05:04:41 +00:00
PDF_PARITY_PHASE1_STATUS.md docs(pdf): Phase 1 status, and stop pdf-ui failing for an environmental reason 2026-08-16 16:48:02 +00:00
REMAINING_EXECUTION_PLAN.md test(pay): Phase 5 lifecycle matrix as domain tests (R2.3) 2026-08-02 09:47:52 +00:00
REPO_COVERAGE_100_PLAN.md ci: gate the coverage that was already measured and unenforced (Phase 0) 2026-08-18 10:20:22 +00:00
SPREADSHEET REVIEW.md Initial commit 2026-07-26 19:38:26 +03:00
VALHALLA_1TO1_FULL_PORT_SPECIFICATION.md docs(valhalla): add 1:1 file-by-file audit review and full port specification 2026-07-28 17:37:56 +00:00
VALHALLA_1TO1_PARITY_REVIEW_AND_EXECUTION_PLAN.md docs(valhalla): add 1:1 granular parity audit review and 4-phase completion execution plan 2026-07-28 16:47:34 +00:00
VALHALLA_COMPLETE_PORT_EXECUTION_PLAN.md docs(valhalla): add 1:1 complete port execution plan for remaining Valhalla subsystems 2026-07-27 16:41:47 +00:00
VALHALLA_PARITY_AND_BENCHMARK_REVIEW.md docs(valhalla): add comprehensive parity and performance benchmark review vs C++ Valhalla 2026-07-27 16:30:21 +00:00
VALHALLA_RIDER_MAP_INTEGRATION_PLAN.md feat(map): add RouteRenderPass to RenderGraph and document rider map integration plan 2026-07-28 18:56:27 +00:00
VALHALLA_TEST_COVERAGE_ANALYSIS_AND_PLAN.md test(valhalla): expand unit and integration test coverage across all subcrates and add coverage analysis plan 2026-07-28 17:15:10 +00:00
VALHALLA_VS_MAKEPAD_ROUTING_ANALYSIS.md docs(valhalla): add deep architectural comparison of valhalla-rs vs makepad map navigation layer 2026-07-31 18:32:14 +00:00