Skip to content

⚡ Bolt: Optimize wordchains BFS traversal#1014

Merged
aaylward merged 5 commits intomainfrom
bolt-wordchains-perf-opt-6111173044990645516
Feb 17, 2026
Merged

⚡ Bolt: Optimize wordchains BFS traversal#1014
aaylward merged 5 commits intomainfrom
bolt-wordchains-perf-opt-6111173044990645516

Conversation

@aaylward
Copy link
Copy Markdown
Collaborator

💡 What: Optimized bfs_for_target in domains/games/libs/wordchains to use usize indices instead of String for graph traversal.
🎯 Why: The original implementation cloned strings and used HashMap<String, ...> for every node visit, causing unnecessary memory allocation and hashing overhead.
📊 Impact: Significantly faster BFS traversal (O(1) vector access vs O(L) string hashing/cloning).
🔬 Measurement: Verified by running cargo test -p wordchains. All tests passed.


PR created automatically by Jules for task 6111173044990645516 started by @aaylward

Replaces string-based HashMap lookups and cloning in `bfs_for_target` with
integer-based BFS using `usize` indices and parallel vectors.
This eliminates significant memory allocation and hashing overhead during graph traversal.
Verified with existing tests.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

aaylward and others added 4 commits February 17, 2026 05:24
Modifies `scripts/diff-build` to use `--skip_incompatible_explicit_targets`
and `--keep_going` when running `bazel build` and `bazel test`.
This prevents CI failures when `bazel-diff` identifies targets (e.g., iOS apps)
that are incompatible with the CI runner's platform (e.g., Linux).

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Updates `scripts/diff-build` to filter out targets tagged as `manual` using
`bazel query` before passing them to the build command.
This prevents `bazel-diff` from attempting to build iOS targets (tagged manual)
on Linux CI runners, which caused toolchain resolution errors.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Modifies `scripts/diff-build` to explicitly filter out `wordchains_ios` targets
on non-Darwin platforms using string matching.
Previous attempts using `bazel query` and filtering by `manual` tag were insufficient
because `bazel-diff` includes generated targets (like .ipa, .zip) which do not
consistently expose tags to `bazel query` in the script's context, leading to
analysis failures on Linux CI runners.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@aaylward aaylward enabled auto-merge (squash) February 17, 2026 15:36
@aaylward aaylward merged commit 5949a11 into main Feb 17, 2026
9 checks passed
@aaylward aaylward deleted the bolt-wordchains-perf-opt-6111173044990645516 branch February 17, 2026 15:52
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.

1 participant