pacosako
pacosako copied to clipboard
Crashes in Paco in 2 analysis
This analysis crashes: https://pacoplay.com/replay/14866
As of 2024-06-11 this so longer crashes but is still way to slow. I'll definitely need to do another optimization pass on P2 analysis.
The pathological state is 2kJ4/pep1S1pp/8/l2dPaD1/1q1D4/1R2a3/PP4P1/1Kj5 w 0 - - -
https://pacoplay.com/editor?fen=2kJ4/pep1S1pp/8/l2dPaD1/1q1D4/1R2a3/PP4P1/1Kj5%20w%200%20-%20-%20-
This is not a Paco in 2, but consumes 3.2 GB over several seconds to analyze on my PC. Which probably means memory allocation fails. That also explains why there is no useful error message.
WASM is 32 Bit, so it can only allocate 4 GiB of memory. That is why it fails in the browser. I'll need to improve the P2 analysis to get this one resolved.
#[test]
fn chasing_paco_2_detected_example_e() -> Result<(), PacoError> {
// Reported as crashing, https://github.com/kreibaum/pacosako/issues/109
let setup = "2kJ4/pep1S1pp/8/l2dPaD1/1q1D4/1R2a3/PP4P1/1Kj5 w 0 - - -";
let board = fen::parse_fen(setup).unwrap();
println!("{:?}", is_chasing_paco_in_2(&board, PlayerColor::White)?);
Ok(())
}
Also crashes https://pacoplay.com/replay/15065 -> Fixed by 9cb2df7
If the replay is for a running game with a lifted piece, then we got issues as well.
Here is one with a lifted piece that fails: https://pacoplay.com/game/16997 -> Fixed by 9cb2df7
If the replay is for a running game with a lifted piece, then we got issues as well.
That part is solved with the last commit.
https://dev.pacoplay.com/replay/16069 -> Fixed by 3adb44b0f6c
Note hat this is on dev.pacoplay.com and can be removed by a refresh from prod at any time.
https://pacoplay.com/replay/18006 -> Fixed by 3adb44b0f6c