feat(tidy3d): FXC-5311-enable-cached-loading-from-batch-data#3234
Merged
marcorudolphflex merged 1 commit intodevelopfrom Feb 6, 2026
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
779e748 to
b2a5769
Compare
Contributor
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
tidy3d/web/api/container.pyLines 640-659 640 return self._cache_enabled
641
642 self._cache_enabled = False
643 if WASM_BUILD:
! 644 return False
645
646 try:
647 cache_config = config.batch_data_cache
! 648 except AttributeError:
! 649 return False
650 if not cache_config.enabled:
! 651 return False
652
653 max_bytes = int(cache_config.max_total_size_gb * (1024**3))
654 if max_bytes <= 0:
! 655 return False
656
657 total_size = 0
658 for task_path in self.task_paths.values():
659 try: |
e2e99f6 to
9b92ff8
Compare
9b92ff8 to
4ad9e26
Compare
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.
What changed
BatchDataaccess when results are already downloaded and the total size of all batch data files stays under a configurable threshold.config.batch_data_cache.max_total_size_gb(with enabled) to control this behavior.Why
web.loadcalls when users iterate or index batch results multiple times, while preventing large batches from staying in memory.Note
Medium Risk
Changes data-loading behavior in
BatchDataand adds stateful caching, which could impact memory usage and freshness if edge cases aren’t covered; guarded by a size threshold and explicit config flags.Overview
Speeds up repeated access to
td.web.BatchDataresults by optionally caching loaded task data objects in memory when the batch’s local result files are already present and their combined size is below a configurable threshold.Introduces a new config section
config.batch_data_cache(withenabledandmax_total_size_gb) and wiresBatchData.load_sim_data()/__getitem__to reuse cached objects when eligible, while explicitly disabling the behavior for WASM builds and for large/non-downloaded batches. Documentation, changelog, and new unit tests cover cache-hit vs cache-miss behavior based on total file size.Written by Cursor Bugbot for commit 4ad9e26. This will update automatically on new commits. Configure here.