Skip to content

python-math #17: 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

python-math #17: 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

What

Two changes to comment prioritization:

How it works

The current tick's group-votes are stored on self.group_votes each tick in both modes (like self.pca), as the in-memory analogue of Clojure persisting :group-votes in math_main (the math results table). The restart seam — reloading group-votes on from_dict / poller reload — is deferred to the poller equivalence phase and noted in the journal.

Stale-mirror test sites reworked:

  • The designed xfail on test_priority_metric_non_meta_squared is harvested: the formula test now gates.
  • TestD12CommentPriorities now pins varied (non-all-49) Python output plus coverage, instead of the mirror signature.
  • The exact-value comparison in test_legacy_clojure_regression.py::test_comment_priorities is xfailed for ALL variants — the reference blobs predate the Clojure fix(math): restore priority-based comment routing (regression from #1961) #2611 fix, so value parity is validated by the H-B replay battery (the scripts/certify.py Clojure-vs-Python replay comparison) until the blobs are regenerated with a fixed generator.

Testing

TDD: tests/test_priority_unmirror.py — RED observed (formula tests fail on the mirror; prev-tick flow + group_votes storage fail on the old wiring), 7 GREEN after. Targeted runs: 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.

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… feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes Jul 22, 2026
This was referenced Jul 25, 2026
@jucor
jucor force-pushed the spr/edge/a85047a7 branch from d5400c0 to ce026f3 Compare July 28, 2026 00:11
@jucor jucor changed the title feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes python-math #17: feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes Jul 28, 2026
…d) + Q2 prev-tick group-votes

## What

Two changes to comment prioritization:

- 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 mirror of bug #1961 (the meta-tid routing bug that flattened every comment's priority to ~49, which #2571 had us reproduce for parity) is no longer the parity behavior — the correct formula is.
- Replicate quirk Q2 (`delphi/docs/CLOJURE_QUIRKS.md`): 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 (the engine setting that reproduces the old Clojure engine's behavior exactly) now consumes the captured previous-tick group-votes (`{}` on the first tick, matching Clojure's nil); improved mode keeps the current-tick read.

## How it works

The current tick's group-votes are stored on `self.group_votes` each tick in both modes (like `self.pca`), as the in-memory analogue of Clojure persisting `:group-votes` in `math_main` (the math results table). The restart seam — reloading group-votes on `from_dict` / poller reload — is deferred to the poller equivalence phase and noted in the journal.

Stale-mirror test sites reworked:

- The designed xfail on `test_priority_metric_non_meta_squared` is harvested: the formula test now gates.
- `TestD12CommentPriorities` now pins varied (non-all-49) Python output plus coverage, instead of the mirror signature.
- The exact-value comparison in `test_legacy_clojure_regression.py::test_comment_priorities` is xfailed for ALL variants — the reference blobs predate the Clojure #2611 fix, so value parity is validated by the H-B replay battery (the `scripts/certify.py` Clojure-vs-Python replay comparison) until the blobs are regenerated with a fixed generator.

## Testing

TDD: `tests/test_priority_unmirror.py` — RED observed (formula tests fail on the mirror; prev-tick flow + group_votes storage fail on the old wiring), 7 GREEN after. Targeted runs: 13 passed (unmirror + float-serialization), 21 passed (D12/priority subset), 4 xfailed (legacy regression value comparisons).

commit-id:a85047a7
@jucor
jucor force-pushed the spr/edge/d4116474 branch from 2040fcc to e70dd41 Compare July 28, 2026 01:10
@jucor
jucor force-pushed the spr/edge/a85047a7 branch from ce026f3 to c1dcdf5 Compare July 28, 2026 01:10
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