Skip to content

Weighted Score: shared multi-stat sort across PoB - #9845

Open
mcagnion wants to merge 37 commits into
PathOfBuildingCommunity:devfrom
mcagnion:feature/weighted-score
Open

mcagnion wants to merge 37 commits into
PathOfBuildingCommunity:devfrom
mcagnion:feature/weighted-score

Conversation

@mcagnion

@mcagnion mcagnion commented May 10, 2026 •

Copy link
Copy Markdown
Contributor

Description of the problem being solved:

The Item DB list, Anoint Notable picker, Tree heatmap, and Power Report all rank candidates against a single chosen stat: Life, EHP, Total DPS, Armour, etc. When a build cares about a combination of stats (e.g., 100% Full DPS, 50% EHP, 50% Life Regen, 30% Movement Speed) sorting by a single stat can only approximate that combination.

This PR adds a Weighted Score option across the shared stat-based ranking surfaces, including the Item DB, Anoint Notable picker, Tree and Compare Power Reports, item modifier and crafted-affix selectors, and Timeless Jewel fallback weighting. The weights reuse the Trade Query's Stat Weight Multipliers, so configured trade weights produce the same ranking everywhere.

An Edit Weights... entry opens the existing Stat Weight Multipliers popup. Saving immediately refreshes surfaces that rank existing candidates; the Timeless Jewel finder preserves its explicit Generate action after weights are changed.

Steps taken to verify a working solution:

  • Added focused coverage for weighted-score calculation, Trade Query integration, Tree and Compare reports, item and notable databases, crafted-affix sorting, modifier selectors and Timeless fallback weighting.
  • Manually verified the added selectors, weight editing and restoration of the active Weighted Score selection.

Items tab: Unique DB list sorted by Weighted Score

itemdb-sorted-by-weighted-score

Inline "Edit Weights..." entry in the Sort dropdown

heatmap-dropdown-action-entry

Anoint picker: Notable list sorted by Weighted Score

notable-anoint-sort-weighted-score

Power Report sorted by Weighted Score:

heatmap-weighted-score

@mcagnion
mcagnion marked this pull request as draft May 10, 2026 07:07
@mcagnion mcagnion changed the title Weighted Score: shared multi-stat ranking across sort surfaces Weighted Score: shared multi-stat sort across PoB May 10, 2026
@mcagnion
mcagnion marked this pull request as ready for review May 12, 2026 21:40
@mcagnion
mcagnion force-pushed the feature/weighted-score branch from 359f900 to 0c331b0 Compare July 26, 2026 19:31
@mcagnion
mcagnion marked this pull request as draft July 26, 2026 19:44
@mcagnion
mcagnion force-pushed the feature/weighted-score branch from 7a269ae to ddeca82 Compare July 28, 2026 09:19
@mcagnion
mcagnion force-pushed the feature/weighted-score branch 3 times, most recently from c48337f to 4042a77 Compare August 6, 2026 10:43
@mcagnion
mcagnion force-pushed the feature/weighted-score branch from 074c6f6 to c7fe989 Compare August 15, 2026 15:55
@mcagnion
mcagnion marked this pull request as ready for review August 21, 2026 09:07
@mcagnion
mcagnion force-pushed the feature/weighted-score branch from 70a1a53 to d68cdf3 Compare August 26, 2026 18:17
Use one set of weights and one ratio calculation for passive-tree and item rankings. Keep weight editing in Trade Query and expose the score through the shared power-stat list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cover default and custom weights, ratio edge cases, Trade Query scoring, and passive-tree integration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Propagate Weighted Score through the Anoint sort list and calculate each notable instead of leaving every score at zero.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Weighted Score is calculated rather than stored in a calc output field. Expose it through the shared power-stat callback so other consumers can request the score without duplicating the calculation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Loading WeightedScore inside getValue created a new module table on every call. Load it once at module scope for tight loops such as Radius Jewel Finder calculations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Timeless Jewel fallback weights previously read a nonexistent output field and collapsed every node to the same result. Use the Weighted Score callback and guard a zero baseline.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fallback dropdown entries copied only the stat, transform, and label, dropping the callback needed by Weighted Score. Carry getValue into each entry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use Full DPS when the active weights require it and reuse the cached baseline for Weighted Score calculations.
Use one dropdown action across Tree, Item DB, and Anoint selectors. Keeping the action inside the menu leaves the League filter available in the narrow Item DB pane.
Restore the shared accessor, transforms, and Full DPS fallback expected by Trade Query.
Avoid generating a Minion Weighted Score entry and hide the score from modifier menus that can only read stored output fields.
Keep negative scores and request Full DPS only when the active weights need it.
Calculate candidates with the matching Full DPS context and retain the baseline output for Timeless Jewel fallback scoring.
Evaluate contextual metrics against the displayed item baseline so Weighted Score and Full DPS rank candidates correctly.
Forward the callback when Reset reopens the editor so the next Save invalidates caller caches.
Evaluate crafted prefix and suffix candidates through the contextual stat API so Weighted Score uses its baseline and Full DPS requirements instead of tying every modifier at zero.
Keep crafted affix, Compare Power, and Timeless fallback scoring aligned with saved weights.
Remove redundant type and action flags, then route existing consumers through
the shared power-stat accessors while preserving their score contracts.
Name the weighted ratio accumulator by its actual result and document why the
synthetic power-stat value shares the trade-query scale across consumers.
Keep the Trade Query lookup in the shared WeightedScore module while preserving each consumer's local invalidation behavior.
Preserve all 39 weighted-score scenarios while grouping related cases into 19 labelled contracts and removing a redundant Power Builder run.
Keep the generic allocated-node filter and its regression coverage on the
dedicated Power Report bugfix branch.
Align stat, output, and selection names with their actual data shapes, and
document the shared editor callback and score scaling invariants.
Rank contextual Anoint and crafted-affix candidates against the displayed item while preserving scalar Anoint deltas against the no-anoint baseline.
Share local fixtures and bound the Power Builder smoke to reduce review cost. Replace the Timeless editor-only check with real Weighted Score fallback generation.
Keep the allocated-node filter and its tests on the dedicated Power Report branch.
Use divergent direct and fallback ratios so the contract fails if FullDPS branch selection regresses.
Add the current-build case to the existing exact-score test and remove the weaker non-zero check.
Carry the existing Weighted Score path across the upstream Add Implicit extraction. Use the displayed item as the baseline and rerank the list after weight edits.
@mcagnion
mcagnion force-pushed the feature/weighted-score branch from da4e8a3 to 53ece6f Compare September 27, 2026 12:23
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.

1 participant