Bug - Confirmed Maximizer didn't equip a weapon

effective won't allow a toy accordion for a weapon for a Seal Clubber.

Test:
Java:
public void musEffectiveIgnoresTwoHandedRangedWeapon() {
String maxStr = "effective";
var cleanups =
new Cleanups(
withStats(25, 17, 20),
withEquippableItem("Toy Accordion"),
withSkill("tricky knifework")
// withEquippableItem("boot knife")
);

try (cleanups) {
assertTrue(maximize(maxStr));
assertThat(getBoosts(), not(hasItem(recommendsSlot(Slot.WEAPON))));
//assertThat(getBoosts(), not(hasItem(recommendsSlot(Slot.OFFHAND))));
}
}
This puts none at the top of the list.

I am putting the Candy Cane Sword Cane and the August Scepter into the mix, and I'm not 100% sure what it's doing. I want the answer to be both of them, but I'm not finding the key point at which it stops offering the CCSC.
 
I've been hitting this a lot in Legacy of Loathing, even quite deep into the run.

I think it's because I have Master of the Surprising Fist and Kung Fu Hustler, and at the start of the run I only have weapons without enchantments, so it values the DR from Master of the Surprising Fist.

Why it continues past the point where I have weapons with better enchantments I don't know.
 
Bump

r28855 made a change to how no weapon is handled during maximization. Perhaps that change effects this?
 
So, I turned to chatGPT for this issue. The bot thinks it found an issue. It made a failing test and a patch that fixes that failing test.
What was wrong: The maximizer can end with an offhand equipped and no weapon even when a 1‑handed weapon + offhand combo would score higher. This happens because 1‑handed weapons are shortlisted based on their solo score. If a 1H weapon’s individual delta is negative (even slightly), it gets pruned and never paired with a strong offhand, so the combination search can’t discover the best combo.​
How it was solved: After the primary equipment search, if the best result has an offhand but no weapon, we now re‑evaluate that best result with each available 1‑handed weapon candidate (including previously pruned negatives) and replace the best result if any combo improves the score. This is a minimal, targeted “second‑chance” pass that only runs in the specific offhand‑only case and uses the same scoring constraints as the main search.​

We did come up with a combo where the score of 1H+ OH > nothing+OH, and it was not finding that, perhaps for the reason it stated. It tests for exactly this.

The combination of yam cannon + august scepter should beat nothing + august scepter. (and either beat the toy accordion).
Base score: 603.3000000000001
Offhand only score: 1853.3
1H + offhand score: 1875.8
2H score: 1605.55

The theory is that the evaluator is dropping any item that would fail by itself, but which can in conjunction with the august scepter, pass and have a higher score.

Please review the pull request thoroughly. I have reviewed the design and I didn't see any obvious flaws, but I feel like this needs more eyes on it.

 
Back
Top