Skip to content

Conversation

andrewvarga
Copy link
Contributor

@andrewvarga andrewvarga commented Sep 17, 2025

Pair of https://github.com/KittyCAD/engine/pull/3625/files
Definitely not ready for merge, but ready for review. When ready it needs to be deployed carefully in sync with the above PR.

This PR generates ids in the artifact graph for extrusion without calling Solid3dGetExtrusionFaceInfo and Solid3dGetAdjacencyInfo.

I discussed with @Irev-Dev and our preference is to have this enabled for all sweep-like operations and with that remove the above commands completely. This PR only deals withs the actual extrude operation for now but it's an easy change to enable it for the other sweeps.

There is a known bug which is yet to be discovered whether it's in this PR or the engine PR: certain extruded faces (at most 2 walls) are not selectable because the frontend generated ids are not matching the engine generated ones.

@andrewvarga andrewvarga requested a review from a team as a code owner September 17, 2025 18:44
Copy link

vercel bot commented Sep 17, 2025

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

Project Deployment Preview Comments Updated (UTC)
modeling-app Ready Ready Preview Comment Sep 29, 2025 3:31pm

ast,
item_count,
exec_artifacts,
&id_generator,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is passed to artifacts_to_update so the original Segments can be created with the new ids.

// If we are creating a new body we need to preserve its new id.
if extrude_method != ExtrudeMethod::New {
sketch.id = face.solid.sketch.id;
if generate_predictive_ids {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just a temporary flag to enable the new id generation (turned on for extrude only), or keep using the previous code.
It can be deleted if we change this for all sweep operations.

return_arr.push(Artifact::Path(inner_path_artifact))
}

if let ModelingCmd::Extrude(kcmc::Extrude { .. }) = cmd {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is where the artifact graph is populated with the extrusion related artifacts.

Copy link

codspeed-hq bot commented Sep 17, 2025

CodSpeed Instrumentation Performance Report

Merging #8332 will degrade performances by 18.58%

Comparing andrewvarga/8162/predictive-ids-idgenerator (4dbd484) with main (aa65d3b)

Summary

❌ 1 regression
✅ 138 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
mock_execute_mike_stress_test_program 302.8 ms 371.9 ms -18.58%

Comment on lines +1045 to +1050
let face_id = id_generator.get_face_id();
let next_face_id = id_generator.get_next_face_id(path.seg_ids.len() as u32);
let curve_id = id_generator.get_curve_id();
let opposite_edge_id = id_generator.get_opposite_edge_id();

let adjacent_edge_id = id_generator.get_adjacent_edge_id();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the order these are called important, does it have to generate them in the same order as the engine?

Copy link
Contributor

Choose a reason for hiding this comment

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

I answered my own question. They are all derived on the current segment index, so the order of these don't mater.

And later in the loop id_generator.next_edge(); is how it progresses the segment index . . . I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, exactly! It would be cleaner to use something like an Iterator in this particular code location but there are others where it was much less disruptive to the existing code to have a manual way to step the index:
https://github.com/KittyCAD/modeling-app/pull/8332/files#diff-5bd2a5278e05b85f158d1fbb3f690cbd1fddf47dc21d035baa23cdcf1bde16daR632

Copy link
Contributor

@Irev-Dev Irev-Dev left a comment

Choose a reason for hiding this comment

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

Looking good to me so far!

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