kreibaum / pacosako

This code drives the pacoplay.com website where you can play Paco Ŝako.
http://pacoplay.com
MIT License
23 stars 3 forks source link

Crashes in Paco in 2 analysis #109

Open kreibaum opened 10 months ago

kreibaum commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago
    #[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 commented 10 months ago

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

kreibaum commented 9 months ago

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

kreibaum commented 6 months ago

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

kreibaum commented 6 months ago

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 commented 3 months ago

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 commented 3 months ago

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