feat(math): add POLISMATH_ENGINE_MODE flag + prev-tick warm-start scaffolding (PR-A)#2618
Draft
jucor wants to merge 1 commit into
Draft
feat(math): add POLISMATH_ENGINE_MODE flag + prev-tick warm-start scaffolding (PR-A)#2618jucor wants to merge 1 commit into
jucor wants to merge 1 commit into
Conversation
This was referenced Jul 18, 2026
jucor
marked this pull request as draft
July 18, 2026 01:48
This was referenced Jul 18, 2026
This was referenced Jul 18, 2026
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
…ffolding (PR-A)
Introduces the engine-mode switch that will select between Clojure-parity
warm-start (`clojure-legacy`) and the current cold-recompute behavior
(`improved`, default). This commit only adds the flag and the plumbing to
capture the previous tick's state; no behavior changes yet (commits B and D
consume the captured state).
- New polismath/utils/engine_mode.py: ENGINE_MODE_* constants +
resolve_engine_mode(), reusing pca._resolve_impl_flag (pca.py:37-57) so
resolution rules match the PCA-solver switch. Default 'improved'.
- Conversation.__init__ gains cold-default fields group_clusterings={} and
group_k_smoother={} (Clojure threads these on the conv,
conversation.clj:433-484; NOT persisted, per conv_man.clj:52-74).
- recompute() captures prev_pca / prev_group_clusterings /
prev_group_k_smoother from the deepcopied `result` BEFORE the compute steps
overwrite them (mirrors Clojure fnks reading the incoming conv:
conversation.clj:385, 457) and threads them into _compute_pca /
_compute_clusters as optional params (unused in this commit).
TDD RED evidence (before implementing engine_mode.py):
tests/test_engine_mode.py collection error:
"ModuleNotFoundError: No module named 'polismath.utils.engine_mode'"
Cold-start invariance guard: a single-shot vw pipeline run is byte-identical
under both modes (first-tick warm-start state is empty, so the modes must
coincide). This guards commits B and D from drifting on the cold path.
Tests: 8 new (7 flag-resolution + 1 cold invariance). Full suite 414 passed,
17 skipped, 47 xfailed (was 406/17/47).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
commit-id:d61d82ad
Delphi Coverage Report
|
This was referenced Jul 18, 2026
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.
Introduces the engine-mode switch that will select between Clojure-parity
warm-start (
clojure-legacy) and the current cold-recompute behavior(
improved, default). This commit only adds the flag and the plumbing tocapture the previous tick's state; no behavior changes yet (commits B and D
consume the captured state).
resolve_engine_mode(), reusing pca._resolve_impl_flag (pca.py:37-57) so
resolution rules match the PCA-solver switch. Default 'improved'.
group_k_smoother={} (Clojure threads these on the conv,
conversation.clj:433-484; NOT persisted, per conv_man.clj:52-74).
prev_group_k_smoother from the deepcopied
resultBEFORE the compute stepsoverwrite them (mirrors Clojure fnks reading the incoming conv:
conversation.clj:385, 457) and threads them into _compute_pca /
_compute_clusters as optional params (unused in this commit).
TDD RED evidence (before implementing engine_mode.py):
tests/test_engine_mode.py collection error:
"ModuleNotFoundError: No module named 'polismath.utils.engine_mode'"
Cold-start invariance guard: a single-shot vw pipeline run is byte-identical
under both modes (first-tick warm-start state is empty, so the modes must
coincide). This guards commits B and D from drifting on the cold path.
Tests: 8 new (7 flag-resolution + 1 cold invariance). Full suite 414 passed,
17 skipped, 47 xfailed (was 406/17/47).
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
commit-id:d61d82ad
Stack: