Skip to content

feat: add CuriousAlgorithm and CuriousPlayer - #16

Open
trethore wants to merge 1 commit into
Wynncraft:mainfrom
trethore:pr/curious-algo
Open

feat: add CuriousAlgorithm and CuriousPlayer#16
trethore wants to merge 1 commit into
Wynncraft:mainfrom
trethore:pr/curious-algo

Conversation

@trethore

@trethore trethore commented May 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds Curious, a new skill point solver still focused on having the best performances possible.

What changed

In this PR you can find:

  • Added CuriousAlgorithm and registered it in the algorithm registry.
  • Added CuriousPlayer, a lightweight player implementation used by the new algorithm.

New algorithm

Curious Algorithm is the more aggressive version of Starving Goblin. It keeps the same fast paths for free items, positive-only items, and safe early returns, but adds heavier caching around prepared equipment data so repeated runs avoid decoding the same items again.

When negative bonuses are present, Curious still only rechecks the requirements that can actually be affected by those negatives. Before falling back to the pruned DFS, it also tries a greedy pass to catch common cases without opening the full search.

It performs especially well when the same player or equipment prefix is reused, since it can restore precomputed arrays, free-item aggregates, requirement masks, and impact masks instead of rebuilding everything from scratch.

Of course, the best thing to do is to see the algo source code by yourself!

Validation

Tests pass for Curious.

Benchmarks:

on FullEquipBenchmark 

------------------------------------------------------------------------
  Algorithm                      Mean(ns/op)     Median      Worst     vs 1st
  ----------------------------------------------------------------------
  Curious Algorythm V1               51,723     52,525     70,781       1,0x
  TheCuteCatAlgo V1                 340,265    330,180    368,062       6,6x
  MySecondAlgorithm V1              348,822    344,020    384,119       6,7x
  OurSecondAlgorithm V1             356,391    346,963    391,293       6,9x
  TheFourthAlgorithm V1             358,114    335,938    414,268       6,9x
  TheThirdAlgorithm V1              370,034    366,311    439,778       7,2x
  MyFirstAlgorithm V1               375,051    377,494    421,350       7,3x
  Starving Goblin V2                522,436    482,979    871,282      10,1x
  Negative Order V2                 568,124    517,904    965,373      11,0x
  Capy Topo V2                      676,110    685,102   1086,678      13,1x
  Pruned Mask V2                    838,177    812,660   1802,793      16,2x
  WynnSolver V1                     859,422    935,914   1106,829      16,6x
  GreedyAlgorithm V1                879,857    865,687   1285,465      17,0x
  Subtractive BnB V1               1017,527    701,930   2765,855      19,7x
  Pruned Mask V1                   1676,399   1739,163   2010,450      32,4x
  Wynncraft Fruma V1               1795,891   1929,635   2733,434      34,7x
  SCCGraphAlgorithm V1            10808,927  10797,109  12551,399     209,0x
  CascadeBound V1                 64708,761  63396,021  75127,331    1251,1x
========================================================================

on OneByOneBenchmark

------------------------------------------------------------------------
  Algorithm                      Mean(ns/op)     Median      Worst     vs 1st
  ----------------------------------------------------------------------
  Curious Algorythm V1             1340,845   1340,845   1604,324       1,0x
  Starving Goblin V2               4895,197   4895,197   5722,029       3,7x
  TheThirdAlgorithm V1             4958,010   4958,010   5343,848       3,7x
  TheCuteCatAlgo V1                5006,049   5006,049   5332,649       3,7x
  OurSecondAlgorithm V1            5037,216   5037,216   5486,086       3,8x
  TheFourthAlgorithm V1            5291,540   5291,540   5893,255       3,9x
  MySecondAlgorithm V1             5423,180   5423,180   6596,674       4,0x
  MyFirstAlgorithm V1              5748,606   5748,606   6568,470       4,3x
  GreedyAlgorithm V1               9056,569   9056,569  11252,515       6,8x
  WynnSolver V1                   10536,634  10536,634  12208,459       7,9x
  Negative Order V2               14094,007  14094,007  15196,228      10,5x
  Subtractive BnB V1              21962,647  21962,647  22720,080      16,4x
  Pruned Mask V2                  23264,968  23264,968  37065,915      17,4x
  Capy Topo V2                    26257,668  26257,668  30481,737      19,6x
  Pruned Mask V1                  28808,000  28808,000  33937,431      21,5x
  Wynncraft Fruma V1              40014,109  40014,109  40260,023      29,8x
  SCCGraphAlgorithm V1            94811,644  94811,644 102670,437      70,7x
  CascadeBound V1                142525,970 142525,970 146536,814     106,3x
========================================================================

Ran with .\gradlew.bat jmh "-PjmhArgs= -wi 1 -i 1 -f 1"

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