Repository navigation
Pipes: an edit elsewhere in the design no longer builds every later pipe again (#27046) - #27052
MarkusReichart wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Code <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…t changes (tangency-labs#27046) The test fails: Feature::reads has no arm for a pipe, so the pipe is built again after every change before it. Co-Authored-By: Claude Code <noreply@anthropic.com>
…get bodies (tangency-labs#27046) Feature::reads had no arm for a pipe, so every pipe was built again after any change before it, even a change in another part. A pipe along curves of a sketch of its own component now reads that sketch and the bodies it cuts or joins (a new body reads none), as the Extrude arm does. Its path's placement is in its key already (placement_digest). A pipe along a body's edges still reads everything. The arm follows the patch in the issue. Co-Authored-By: Claude Code <noreply@anthropic.com>
Change
SolidCraft keeps a cache of each feature's result. After an edit, it builds again only the features whose inputs changed and takes the rest from the cache. A pipe (a tube along a path, as used for cables and tubing) was never taken from that cache. So any edit built again every pipe after it in the timeline, even a pipe in a part the edit doesn't touch (#27046).
The cause:
Feature::readsincrates/doc/src/eval.rssays what a feature reads, and it had no arm for a pipe. Without an arm, a feature counts as reading everything.This PR adds a Pipe arm, as the Extrude arm already does:
placement_digest).path_body) still reads everything, as before.The pipe's result doesn't change. Only the number of features built again after an edit changes. The issue reports 4.66 s against 0.00 s for deleting the first of 40 such parts. The arm follows the patch in the issue.
#23780 (open) gives pipes
target_features, bodies picked by the feature that made them. Whichever of the two lands second must make this Pipe arm read those bodies too, as the Extrude arm will need.Fixes #27046
Changes a default: no
Validation
New test
a_pipe_keeps_its_result_when_a_feature_before_it_changesincrates/doc/src/eval_cost_tests.rs. A block and a pipe sit in two parts. The pipe's part is placed away from the origin. The pipe is 4 mm with a 1 mm wall, along a line, an arc and a line. The test checks how many features each edit builds again (last_recomputed), and that the bodies equal a fresh evaluation each time (name, volume, face names):Results, in WSL (Linux x86_64) with the
ciprofile:cargo nextest run -p solidcraft-doc --cargo-profile ci --lib -E 'test(a_pipe_keeps_its_result_when_a_feature_before_it_changes)'stops at "only the block" with 2 features built again (the block and the pipe), expected 1.cargo fmt --all -- --check, the repository checks (cargo xtaskassets, icons, licences, layers, ui-containers, lists, i18n, mesh-decisions, app-geometry, skills),cargo clippy --workspace --all-targets --profile ci --locked -- -D warningsandcargo xtask wasmpass.cargo nextest run -p solidcraft-doc --cargo-profile ci --profile ciruns 2488 tests, and all 2488 pass.Not run: the tests of the crates that depend on
solidcraft-doc, left to CI. The wall-clock time was not measured here; the times above are the issue's.Screenshots of the behavior (when observable)
None: nothing changes on screen, only the time an edit takes.
Integration status
Branched from
mainat 2cd08d8. Checked againstmainat ba80a25: the branch merges without conflicts, andmainhas changed nothing inFeature::readssince 2cd08d8.Co-written and tested with Claude Code (AI)
Summary by CodeRabbit