pacosako icon indicating copy to clipboard operation
pacosako copied to clipboard

Crashes in Paco in 2 analysis

Open kreibaum opened this issue 1 year ago • 8 comments

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.

kreibaum avatar Nov 04 '23 21:11 kreibaum

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.

kreibaum avatar Nov 05 '23 13:11 kreibaum

    #[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(())
    }

kreibaum avatar Nov 05 '23 13:11 kreibaum

Also crashes https://pacoplay.com/replay/15065 -> Fixed by 9cb2df7

kreibaum avatar Nov 10 '23 08:11 kreibaum

If the replay is for a running game with a lifted piece, then we got issues as well.

kreibaum avatar Nov 20 '23 21:11 kreibaum

Here is one with a lifted piece that fails: https://pacoplay.com/game/16997 -> Fixed by 9cb2df7

kreibaum avatar Mar 04 '24 21:03 kreibaum

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.

kreibaum avatar Mar 05 '24 18:03 kreibaum

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.

kreibaum avatar May 16 '24 19:05 kreibaum

https://pacoplay.com/replay/18006 -> Fixed by 3adb44b0f6c

kreibaum avatar May 26 '24 11:05 kreibaum