Skip to content

feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes#2645

Draft
jucor wants to merge 1 commit into
spr/edge/d4116474from
spr/edge/a85047a7
Draft

feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes#2645
jucor wants to merge 1 commit into
spr/edge/d4116474from
spr/edge/a85047a7

Conversation

@jucor

@jucor jucor commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

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:


⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

… 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
@jucor
jucor marked this pull request as draft July 22, 2026 00:52
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… Jul 22, 2026
@jucor
jucor changed the base branch from spr/edge/d4116474 to edge July 22, 2026 02:01
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes Jul 22, 2026
@jucor
jucor changed the base branch from edge to spr/edge/d4116474 July 22, 2026 02:02
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… Jul 22, 2026
@jucor
jucor changed the base branch from spr/edge/d4116474 to edge July 22, 2026 02:10
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… Jul 22, 2026
@jucor
jucor changed the base branch from spr/edge/d4116474 to edge July 22, 2026 06:50
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes Jul 22, 2026
@jucor
jucor changed the base branch from edge to spr/edge/d4116474 July 22, 2026 06:50
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… Jul 22, 2026
@jucor
jucor changed the base branch from spr/edge/d4116474 to edge July 22, 2026 08:11
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes Jul 22, 2026
@jucor
jucor changed the base branch from edge to spr/edge/d4116474 July 22, 2026 08:11
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… Jul 22, 2026
@jucor
jucor changed the base branch from spr/edge/d4116474 to edge July 22, 2026 09:58
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes Jul 22, 2026
@jucor
jucor changed the base branch from edge to spr/edge/d4116474 July 22, 2026 09:58
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… Jul 22, 2026
@jucor
jucor changed the base branch from spr/edge/d4116474 to edge July 22, 2026 11:20
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes Jul 22, 2026
@jucor
jucor changed the base branch from edge to spr/edge/d4116474 July 22, 2026 11:21
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… Jul 24, 2026
@jucor
jucor changed the base branch from spr/edge/d4116474 to edge July 24, 2026 06:02
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick… feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes Jul 24, 2026
@jucor
jucor changed the base branch from edge to spr/edge/d4116474 July 24, 2026 06:02
@jucor
jucor requested a review from Copilot July 25, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_metric so non-meta comments use the real importance_metric * decay formula (meta remains constant).
  • In clojure-legacy mode, feeds comment priorities using the previous tick’s stored group_votes while 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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants