Skip to content

Speed up point-subgroup traversal - #333

Merged
lan496 merged 1 commit into
developfrom
perf/point-subgroup-traversal
Aug 23, 2026
Merged

Speed up point-subgroup traversal#333
lan496 merged 1 commit into
developfrom
perf/point-subgroup-traversal

Conversation

@lan496

@lan496 lan496 commented Aug 23, 2026

Copy link
Copy Markdown
Member

Summary

  • replace the thread-safe Queue in point-subgroup traversal with collections.deque
  • mark group elements visited when enqueued to avoid duplicate traversal work while preserving result order
  • compare the complete ordered subgroup result with brute-force enumeration in the regression test

Related: https://github.com/lan496/spinforge-dev/issues/193

Test plan

  • .venv/bin/python -m pytest -q (136 passed, 1 skipped)
  • tests/configuration_tests/test_oriented.py::test_noncoplanar_UO2_index4 against local spgrep
  • compare UO2 runtime with the old and new traversal (24.62 s -> 16.18 s)
  • commit-time formatter, Ruff, and mypy hooks on the changed files

Notes

prek run --all-files still reports unrelated pre-existing Ruff findings elsewhere in the repository; the hooks for the files changed by this PR pass.

Co-Authored-By: Codex <noreply@openai.com>
@lan496
lan496 marked this pull request as ready for review August 23, 2026 08:57
@lan496
lan496 merged commit 208a20a into develop Aug 23, 2026
7 checks passed
@lan496
lan496 deleted the perf/point-subgroup-traversal branch August 23, 2026 08:58
@lan496 lan496 added the enhancement New feature or request label Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant