Skip to content

KCL: Fix do_post_extrude querying wrong body for clones/mirrors#12088

Merged
adamchalmers merged 3 commits into
mainfrom
achalmers/try-the-fn-test-again
Jun 12, 2026
Merged

KCL: Fix do_post_extrude querying wrong body for clones/mirrors#12088
adamchalmers merged 3 commits into
mainfrom
achalmers/try-the-fn-test-again

Conversation

@adamchalmers

@adamchalmers adamchalmers commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Terminology note: old body = before clone, new body = after clone

4 problems here:

  1. The logic for choosing the right edge to use in the API queries (i.e. choosing which edge ID to assign to extrusion_info_edge_id) was very confusing to follow, due to mutation. I refactored it to be immutable, and added comments explaining its logic.
  2. The logic was wrong: it was sometimes using an ID from the new body, when it's supposed to query the old body.
  3. The get_adjacency_info call was not using the extrusion_info_edge_id, it was using any_edge_id, which is one of the inputs to the complex logic above, not its final output after carefully analyzing which edge ID to use.
  4. the get_adjacency_info call was using the wrong sketch: sketch_id not sketch.id. I hate that these are two different things.

The broader takeaway is that do_post_extrude sucks, I hate this function and Serena and I have a plan to kill it (see KittyCAD/modeling-api#1130)

Testing

Currently, I've tested it by running a local engine and looking at the logs. Before this, the engine logs Unexpected missing opposite edge encountered during Solid3dAdjacencyInfo::get() from Mike's recent PR. As of this PR, the logs no longer show up.

You can also see the sim test for "christmas_tree_mirror3d_union" has been updated and adds 3 "SweepEdge Adjacent" entries to the artifact graph.

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modeling-app Ready Ready Preview, Comment Jun 12, 2026 5:07am

Request Review

@adamchalmers adamchalmers marked this pull request as ready for review June 12, 2026 04:14
@adamchalmers adamchalmers requested a review from a team as a code owner June 12, 2026 04:14
@adamchalmers adamchalmers force-pushed the achalmers/try-the-fn-test-again branch 2 times, most recently from 1d19c7d to 27e0177 Compare June 12, 2026 04:29
@codspeed-hq

codspeed-hq Bot commented Jun 12, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 26.59%

❌ 1 regressed benchmark
✅ 124 untouched benchmarks
🆕 1 new benchmark
⏩ 151 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation parse_i-beam 16 ms 21.8 ms -26.59%
🆕 Simulation parse_artificial-heart N/A 185.1 µs N/A

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing achalmers/try-the-fn-test-again (27e0177) with main (36d2e6a)2

Open in CodSpeed

Footnotes

  1. 151 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (b4c3fbf) during the generation of this report, so 36d2e6a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@jtran jtran left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@jtran

jtran commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #11994.

@adamchalmers adamchalmers merged commit fd73dfb into main Jun 12, 2026
68 of 74 checks passed
@adamchalmers adamchalmers deleted the achalmers/try-the-fn-test-again branch June 12, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants