Add prime-or-square-or-semiprime-window procedural heuristic and metadata#26
Merged
GISMO-1 merged 1 commit intoMar 2, 2026
Merged
Conversation
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.
Motivation
Description
prime-or-square-or-semiprime-windowinsrc/strausforge/identities.pythat preservesprime-or-square-windowbehavior for primes/squares and otherwise applies semiprime gating (bounded SPF) to choose the semiprime action (128 initial window) or default (8).PROC_HEURISTIC_CHOICESand update CLI help/error strings insrc/strausforge/cli.pyso all relevant commands accept and document the new heuristic.semiprime_window_triggerinsrc/strausforge/hardness_core.pywhen emitting expanded-case metadata and addproc_stage(one of"prime"|"square"|"semiprime"|"none"),semiprime_triggered(bool), andspf_bound_used(int) to exported records.tests/test_identities_verify.pyand updatetests/test_factor_meta.pyto exercise combined-heuristic parity with POSW on prime/square inputs and semiprime triggering behavior, and to assert the newproc_stagefield is present.Testing
python -m pip install -e '.[dev]'and ran linting withruffto validate formatting and imports, which passed after formatting fixes.pytest -q tests/test_identities_verify.py tests/test_factor_meta.py tests/test_cli.pyand the full suitepytest -q, with all tests passing (final run:77 passed, 1 skipped).run_hardnessover22_000_000–23_000_000withproc_heuristic='prime-or-square-window'andproc_heuristic='prime-or-square-or-semiprime-window'; the results were: POSW expanded =10, combined expanded =0, and combined expanded_primes =0.Codex Task