Repository navigation
Conversation
This was referenced Nov 1, 2026
…ngency-labs#5426) Each kind on a sheet writes out the same add, find by halves, cap, order and check loop. ById holds those, so a kind's own file holds only its own rules, and the file's bytes don't change: it saves as the plain list. Views and dimensions stay on their own lists for now, since other work is on them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ngency-labs#5426 W38e-1) images holds the files and sheet_images each place one sits, so a logo on every sheet costs what one does. drawing.image.add reads the file (bytes and pixels checked from its header before anything decodes it), reuses a file with the same bytes, and saves the bytes without the path. A file goes with the last thing that uses it, which Drawing::images_in_use alone says, and reading a drawing refuses a file nothing uses or a record its file disagrees with. A sheet's list and delete take the placements on it. Deleting one placement waits for selection.delete to take a drawing's objects. Its pixels on paper are W38e-2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CamWight
force-pushed
the
images-on-paper-5426
branch
from
November 3, 2026 13:06
1d6ff5b to
28aabd4
Compare
Contributor
Author
|
Carried in by #10926: its squash into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A drawing had no way to hold image files for its sheets. Now it stores each image file once, and a sheet can place it as many times as it likes, so a logo on every sheet is one copy in the design file. The next change draws these images on paper.
Part of #5425 (W38e), into
drawings: a drawing keeps an image's file once, however many places it sits. Stacked on #10464 for its list type: the first commit here is that PR's, this PR's own is the last. W38e-2 (#10363) gives these files their pixels on paper.Changes a default: no
What it does
imagesholds the files andsheet_imageseach place one sits, so a logo on every sheet costs what one does.drawing.image.add {sheet, file, rect_mm}:Caps: 4 MiB a file, 9 MiB a drawing, 64 million pixels (
geom::paper::MAX_IMAGE_PIXELS), 1000 files, 1000 placements.A file goes with the last thing that uses it, which
Drawing::images_in_usealone says. Reading a drawing refuses a file nothing uses, or a record its file disagrees with. A sheet's list and delete take the placements on it: deleting a sheet that holds images is refused, naming them, unless the call sayscontents: "delete".An older drawing has neither list. The last release refuses a drawing saved with them, as a newer format.
Pictures
No visible change yet: no sheet page shows images, and their pixels on paper are #10363. The real-program check is under Validation.
Tests
crates/doc/src/drawing/image_tests.rs(9): saved and read back the same, one file on two sheets saved once, a file going with its last placement, ids staying apart, caps read before decoding, a file that lies refused on reading, a placement and its file naming each other, a rectangle on paper with a size, a drawing's counts.crates/engine/src/cmd/drawing_image_tests.rs(6): read and saved without its path in one undo step, the same bytes as one file on each sheet, what isn't an image or breaks a cap refused with nothing changed, a file outside the allowed folders refused, an image that would stop the drawing saving refused, an image the drawing has no room for refused.crates/io/src/design/drawing_tests.rs:an_image_on_a_sheet_round_trips_and_a_lying_one_is_refused.Planted faults: 26 of 26 caught, across both commits, 6 of them on the list type, then a clean run. 24 were caught on the first pass. The other two, an empty path reaching the reader and no check that the drawing can still be saved, each got a test and were caught when planted again.
What no test reaches
selection.deleteto take a drawing's objects.render_workspace::tests::progressive_image_controls_route_to_the_registered_hostand thesolidcraft_gpulibrary tests gave no result on this PC (see below). Neither goes through this code, and this PR changes nothing incrates/gpuorcrates/ui-egui. CI's run is the first full result for them.Validation
The full gate on this PC ended exit 1. fmt, assets, icons, licences, lists, layers, UI containers, both clippy runs, wasm and web offline all passed; the tests step failed. This PC's gate skips the robustness goldens. What failed:
solidcraft-clihelp_outputandkill_mid_savewent over their time limits. Infuzz_refuses_an_argument_it_does_not_take,fuzz straydidn't answer within its 20 s, which the test reports as "kept running". Inkilled_mid_save_the_old_file_survives, the saver hadn't got far enough within its 20 s (the binary took 1811 s in all). Both pass alone and matchdrawings9b73ec8:drawingshelp_outputalonekill_mid_savealonefuzz stray, one CPU, median of 5Load is my inference, not proven: 80 test binaries ran on the gate's 8 CPUs, and these two failed in none of the 11 earlier gate logs I checked. Across the whole PC the load had a mean of 54% and a maximum of 81%.
Engine library: 3002 passed, 1 failed,
pattern_of_512_hole_cuts_finishes_in_reasonable_time, a timing test that has failed under load here before.solidcraft_ui_eguilibrary: an access violation (0xc0000005) partway, andmany_faces_are_classified_quicklyfailed. I don't know the violation's cause. Rerun alone in the gate's profile, without the test below: 3600 passed, 0 failed, 14 ignored, no crash, andmany_faces_are_classified_quicklypassed. That rerun used the gate's binary, from a commit that differs from this head only by a code comment.progressive_image_controls_route_to_the_registered_hostspins one thread with no result: it was still running in the gate, and alone it hung past 420 s, with Intel's Vulkan driver disabled. An earlier gate on a commit without this work shows the same test with no result. I haven't run it on currentdrawings.solidcraft_gpulibrary: I stopped it after 1 h 42 min, so it has no result.Real program, on a plain test design through the control channel, safe mode:
[400, 300];drawing.sheet.deleterefuses, naming it;contents: "delete"works, the design saves again and still opens, and there are no crash reports.Integration status
Based on
drawings9b73ec8.Refs #5425, #860