Review on #3594:
- The XCLIP attribute part's `truncated` flag now reaches the parent
list, as the block-contents part's already did. A clipped reference
whose attributes ran out of budget as the last object of a drawing
drew 98 of 105 points and said nothing.
- The parts of a parallel build are joined within the list limits
(Builder::join). Clipped copies are in no shared count, so two XCLIP'd
blocks in different parts could join to 798 primitives against a
limit of 748, unmarked. Parts are appended whole while they fit; at
the first that doesn't, the build is spent and marked truncated. This
is native-only: the web build has no parallel path.
Part of #1603.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On wasm32 a DPrim is 40 bytes and one allocation can take at most
isize::MAX (2 GiB - 1): a list of more than 2^25 primitives panicked
with "capacity overflow" when its vector grew. The 64M-point budget
(#3306) charged a point primitive one point, so it allowed 64M of them;
a 4.5 MB DXF of dotted lines reached 33.56M.
- MAX_DISPLAY_PRIMS, charged once per primitive beside the points and
shared like them: 2^24 on 32-bit targets, equal to MAX_DISPLAY_POINTS
(and not counted) on 64-bit ones, where it can't bind.
- Clipped copies (viewport contents, XCLIP) are appended only while the
list has room within both limits; the append stops at the first piece
that doesn't fit and the build is spent, as when a budget runs out.
Builder::charge checks the same room in its own list.
- Compile-time asserts: the primitive, point, pen, plotted-text and
image vectors stay under isize::MAX bytes at these limits (checked
for wasm32 by the wasm step).
- gpu::build_mesh counts its lines and quads first and allocates each
array once: the quads grew by doubling and passed 1 GiB on large
lists with lineweights shown.
Part of #1603.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: crates/fonts/src/ttf.rs (main made OutlineMesh's points pub(crate); kept that and this PR's bounds field) and crates/render/src/tests.rs (kept this PR's #666 view test and main's fixture-font section).
Main also added a public font-set GENERATION/generation() for redraws (2c979eb1), which clashed by name with this PR's private lookup-cache counter. Renamed this PR's counter to LOOKUP_GENERATION/lookup_generation(), and set_font_dirs now also calls changed() so the per-thread caches drop fonts from removed folders.
cargo test -p cadcraft-fonts -p cadcraft-render and cargo fmt --check pass locally.
One conflict, in crates/engine/src/cmd/modify/select_then.rs: this branch
adds COPY's copy_prompt, copy_input and copy_done just above join_now, and
main (#2725) rewrote join_now's doc comment. Kept both: the COPY methods,
then main's two-line doc. The struct fields (copy_single, copies,
copy_array, ask_circle), SelectThen::new and the match arms merged without
conflict. No behaviour changed on either side.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drawing::linetype, text_style, dim_style and layout scanned their table,
once per entity while a drawing is drawn, measured or saved, and once
per layout after every command. The DXF reader also scanned the
dimension styles once per DIMSTYLE record and the layouts by exact name
once per paper-space object. So a crafted file of N records and N
entities naming one it lacks, N DIMSTYLE records, or N layouts with N
objects in the last of them cost N^2 name comparisons (#1924, F-04
item 3): at N = 40 000 a PNG export took 23 s, opening 107-151 s or
more than 300 s on main.
- linetypes, text_styles, dim_styles and layouts are NamedLists (from
#3484) and the four lookups use its index: the first entry of a name
in list order, ASCII case folded, as the scan returned.
- NamedList::by_name_mut: the first entry of a name to change.
- Scans with the same answer go through the lookup (STYLE, DIMSTYLE,
RENAME, -DIMSTYLE, .lin loading, COMPARE, COUNT, UCS, plotter, DXF
header, Layers panel).
- The DXF reader indexes DIMSTYLE records by lower-cased name, and maps
layout names (exact) to the first layout of that name once per pass.
Cost tests (doc: one per table; io: DIMSTYLE records and layouts) fail
on main at 66-421 s and pass within 3 s; a behaviour test compares
every lookup with a scan.
Part of #1924
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nightly launch fix under Skylar's Exec 454: the Launcher's trailing `--` no longer reaches the file list where that applied, and a refused launch no longer blocks on macOS (the reason goes to stderr and the app exits 2).