Skip to content

Fix to mode solver simulation reduction in web.upload #2583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

momchil-flex
Copy link
Collaborator

@momchil-flex momchil-flex commented Jun 18, 2025

The simulation reduction was happening only after the simulation was already uploaded. 🤦

I don't know if this never worked right, or if it broke at some point - I think the latter.

We have a test here that the reduction function works, but not that the reduced simulation is actually uploaded. I'm not sure if the latter is possible within our mock web tests?

Greptile Summary

Fixed a critical performance issue in mode solver simulations where the simulation reduction was incorrectly occurring after upload instead of before, causing unnecessary data transfer. This bug impacted the efficiency of mode solver tasks by uploading full-sized simulations when reduced versions would suffice.

  • Modified tidy3d/web/api/webapi.py to perform mode solver simulation reduction before Tidy3dStub initialization and upload
  • Existing test confirms reduction function works but lacks verification of reduced simulation upload
  • Improves server-side efficiency by transmitting only the necessary simulation data

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

Diff Coverage

Diff: origin/develop...HEAD, staged and unstaged changes

  • tidy3d/web/api/webapi.py (100%)

Summary

  • Total: 2 lines
  • Missing: 0 lines
  • Coverage: 100%

@momchil-flex momchil-flex added 2.9 will go into version 2.9.* rc2 2nd pre-release labels Jun 19, 2025
Copy link
Collaborator

@yaugenst-flex yaugenst-flex left a comment

Choose a reason for hiding this comment

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

Huh, interesting 😄 LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 will go into version 2.9.* rc2 2nd pre-release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants