Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses incorrect ORCA version detection (issue #130) by extracting the version from the ORCA binary contents instead of parsing it from the executable path, using mmap with a read fallback for robustness.
Changes:
- Updated
PathsConfig.get_orca_versionto search forProgram Version X.Y.Zwithin the ORCA binary viammap, with a fallback to reading bytes if memory-mapping fails. - Added a new unit test file intended to compare mmap-based parsing with the previous full-read approach and print a benchmark.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/censo/config/paths.py |
Switches ORCA version extraction to binary-content parsing using mmap with a read fallback. |
test/unit/test_config/test_paths.py |
Adds a test/benchmark comparing mmap vs full-read parsing (currently environment-dependent). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request improves the way ORCA binary versions are extracted and adds comprehensive tests for the new approach. The main change is switching to memory-mapped file access (
mmap) for parsing the version directly from the binary, which is more efficient. The code now also gracefully falls back to reading the file if memory-mapping fails, ensuring robustness. Additionally, new unit tests have been added to verify correctness and benchmark the performance of both methods.ORCA version extraction improvements:
get_orca_versioninsrc/censo/config/paths.pyto usemmapfor parsing the version from the ORCA binary, with a fallback to reading the file if memory-mapping fails. This improves performance and reliability when extracting the version string.import mmaptosrc/censo/config/paths.pyto support memory-mapped file access.Testing and benchmarking:
test/unit/test_config/test_paths.pyto verify that ORCA version parsing usingmmapmatches the previous method and to benchmark the speedup achieved.fixes #130