feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes#2645
Draft
jucor wants to merge 1 commit into
Draft
feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes#2645jucor wants to merge 1 commit into
jucor wants to merge 1 commit into
Conversation
… group-votes Restore the real priority_metric branching formula in BOTH engine modes: Clojure HEAD passes a real boolean since #2611 (conversation.clj:686, merged 2026-07-18), so the all-49 #1961 bug-mirror (#2571) is no longer the parity behavior — the correct formula is. Q2 (CLOJURE_QUIRKS): Clojure's :comment-priorities node SHADOWS its current-tick group-votes input with (:group-votes conv) — the PREVIOUS tick's stored value (conversation.clj:658). clojure-legacy mode now consumes the captured prev-tick group-votes ({} on the first tick == Clojure's nil); improved mode keeps the current-tick read. The current tick's group-votes are stored on self.group_votes each tick (both modes, like self.pca) as the in-memory analogue of Clojure persisting :group-votes in math_main. Restart seam (from_dict/poller reload of group-votes) deferred to the poller equivalence phase — noted in journal. Stale-mirror test sites reworked: the designed xfail on test_priority_metric_non_meta_squared is harvested (formula test now gates); TestD12CommentPriorities now pins varied (non-all-49) Python output + coverage instead of the mirror signature; the exact-value comparison in test_legacy_clojure_regression.py::test_comment_priorities is xfailed for ALL variants (reference blobs predate the Clojure #2611 fix — value parity is validated by the H-B replay battery until blob regen with a fixed generator). TDD: tests/test_priority_unmirror.py — RED observed (formula tests fail on the mirror; prev-tick flow + group_votes storage fail on old wiring), 7 GREEN after. Targeted: 13 passed (unmirror+float-serialization), 21 passed (D12/priority subset), 4 xfailed (legacy regression value comparisons). commit-id:a85047a7
This was referenced Jul 22, 2026
Draft
Draft
docs(delphi): R1-parity goal docs, journal (2026-07-18 → 07-24 s5), quirks + divergence ledger
#2626
Draft
jucor
marked this pull request as draft
July 22, 2026 00:52
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores the intended (and now Clojure-HEAD-parity) priority_metric branching behavior and updates the Delphi math pipeline to reproduce Clojure’s Q2 “prev-tick group-votes” quirk in clojure-legacy engine mode, with accompanying test updates to reflect the removal of the historical all-49 mirror behavior.
Changes:
- Un-mirrors
priority_metricso non-meta comments use the realimportance_metric * decayformula (meta remains constant). - In
clojure-legacymode, feeds comment priorities using the previous tick’s storedgroup_voteswhile storing current-tick group votes for the next tick. - Reworks/introduces tests to (a) pin the real formula, (b) validate Q2 tick semantics, and (c) mark stale pre-#2611 reference blob value comparisons as xfail.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| delphi/polismath/conversation/conversation.py | Restores real priority_metric logic; threads prev-tick group_votes into legacy comment-priority computation and stores current tick group-votes for next tick. |
| delphi/tests/test_priority_unmirror.py | Adds focused tests for un-mirrored priority formula and Q2 prev-tick group-votes behavior across engine modes. |
| delphi/tests/test_legacy_clojure_regression.py | Marks stale blob exact-value comment-priority parity checks as xfail across variants until blobs are regenerated. |
| delphi/tests/test_engine_mode.py | Adjusts cold-run cross-mode identity test to exclude comment priorities due to Q2 first-tick divergence. |
| delphi/tests/test_discrepancy_fixes.py | Updates D12 comment-priority tests to assert “varied priorities” (no all-49 mirror) rather than constant-value parity. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1451
to
+1455
| current_group_votes = self._compute_group_votes() | ||
| # Stored for the NEXT tick's prev capture (Clojure keeps :group-votes | ||
| # on the conv / in math_main) — in both modes, like self.pca. | ||
| self.group_votes = current_group_votes | ||
| if resolve_engine_mode() == ENGINE_MODE_LEGACY: |
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.
Restore the real priority_metric branching formula in BOTH engine modes:
Clojure HEAD passes a real boolean since #2611 (conversation.clj:686, merged
2026-07-18), so the all-49 #1961 bug-mirror (#2571) is no longer the parity
behavior — the correct formula is.
Q2 (CLOJURE_QUIRKS): Clojure's :comment-priorities node SHADOWS its
current-tick group-votes input with (:group-votes conv) — the PREVIOUS
tick's stored value (conversation.clj:658). clojure-legacy mode now consumes
the captured prev-tick group-votes ({} on the first tick == Clojure's nil);
improved mode keeps the current-tick read. The current tick's group-votes
are stored on self.group_votes each tick (both modes, like self.pca) as the
in-memory analogue of Clojure persisting :group-votes in math_main. Restart
seam (from_dict/poller reload of group-votes) deferred to the poller
equivalence phase — noted in journal.
Stale-mirror test sites reworked: the designed xfail on
test_priority_metric_non_meta_squared is harvested (formula test now gates);
TestD12CommentPriorities now pins varied (non-all-49) Python output +
coverage instead of the mirror signature; the exact-value comparison in
test_legacy_clojure_regression.py::test_comment_priorities is xfailed for
ALL variants (reference blobs predate the Clojure #2611 fix — value parity
is validated by the H-B replay battery until blob regen with a fixed
generator).
TDD: tests/test_priority_unmirror.py — RED observed (formula tests fail on
the mirror; prev-tick flow + group_votes storage fail on old wiring), 7
GREEN after. Targeted: 13 passed (unmirror+float-serialization), 21 passed
(D12/priority subset), 4 xfailed (legacy regression value comparisons).
commit-id:a85047a7
Stack: