31-MAR-2025

0002 - spring-cleaning-1

  1. Cache needs to be refactored to a generic key, ultimately this will be a LRU cache with a generic key type.
  2. Spell needs to have Familiar refactored to rely on a SpellState trait
  3. Tape needs to be renamed to Spell
  4. Move BEN -> -basic
    • This means figuring out the to_fen_position extension, which might be able to stay put? IDK. In theory that means this can just be moved over and no api change, since query is already over there.
  5. FIXMEs, TODOs, and the like need an audit.
  6. Reorganize directory structure
  7. Rename -core to -representation
  8. rename -basic to -core
  9. Get all the tests uncommented (in place) and passing.
    • With caveats, there are still some tests pending a refactor, but I think I got everything that could be easily re-enabled.
  10. nix run #ci
  11. -parser extraction

I think I might go ahead and merge this after a few final checks, and start spring-cleaning-2, maybe after the renames? In -core (right now), there is still:

types/log  # Goes away with the Familiar/Variation rewrite.
coup/rep # should be renamed to `coup` and be a top level module
game/* # needs heavy refactoring to use the new familiar system
interface/ # probably can just live in `game`

That should simplify it a lot and I think I’m done reorganizing after that.

0052 - spring-cleaning-1

I went ahead and got fastchess installed via a derivation in nix/fastchess.nix. This’ll build on the first entry, which sucks a bit, but maybe I can delay that later by hiding the fastchess acceptance tests working behind a flake app or something.

Speaking of, the main purpose for fastchess is going to be the UCI compliance tool that just came out, that’ll help a lot with getting the engine working correctly and saves me a ton of time trying to decipher what the semantics should be, I can just focus on getting the suite to pass.

That’s enough for one day though, the rest of the renaming tomorrow I think, then on to refactoring.

1005 - spring-cleaning-1

        FAIL [   0.017s] hazel-test::zobrist zobrist::zobrist_update_is_idempotent
──── STDOUT:             hazel-test::zobrist zobrist::zobrist_update_is_idempotent

running 1 test
test zobrist::zobrist_update_is_idempotent ... FAILED

failures:

failures:
    zobrist::zobrist_update_is_idempotent

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 8 filtered out; finished in 0.00s

──── STDERR:             hazel-test::zobrist zobrist::zobrist_update_is_idempotent
[tests/zobrist_test.rs:126:13] z1 = Z|0x0000000000000000|
[tests/zobrist_test.rs:126:13] z2 = Z|0x0000000000000000|

thread 'zobrist::zobrist_update_is_idempotent' panicked at /home/jfredett/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/quickcheck-1.0.3/src/tester.rs:165:28:
[quickcheck] TEST FAILED. Arguments: (Assert <b Kk - 8 55390>, Assert <b Kk - 8 31393>)

This is an interesting failure, look at those metadata asserts resulting in a null. Very interesting. It is not particularly common, I assume this is a natural collision, and I’m mostly curious about what components of the thing it’s sensitive too. This test is pretty simple, it takes two random alterations and then calculates:

z1 == z1 ^ z2 ^ z2

Verifying that the zobrist self-inverts, basically. I only log the values out, not the alterations, so I’ve changed that, but since the test is flaky, it’s hard to reproduce, so I added additional logging and hopefully I’ll catch one before too long.

1514 - spring-cleaning-1

  1. Cache needs to be refactored to a generic key, ultimately this will be a LRU cache with a generic key type.
  2. Spell needs to have Familiar refactored to rely on a SpellState trait
  3. Tape needs to be renamed to Spell
  4. FIXMEs, TODOs, and the like need an audit.
  5. Move BEN -> -basic
    • This means figuring out the to_fen_position extension, which might be able to stay put? IDK. In theory that means this can just be moved over and no api change, since query is already over there.
  6. Reorganize directory structure
  7. Rename -core to -representation
  8. rename -basic to -core
  9. Get all the tests uncommented (in place) and passing.
    • With caveats, there are still some tests pending a refactor, but I think I got everything that could be easily re-enabled.
  10. nix run #ci
  11. -parser extraction

I’m gonna rewrite my TODO list now in terms of phase 2.

  • Phase 1
    • Tag audit
  • Phase 2
    • Cache Refactor
    • Variation Refactor to use Spell + Tape->Spell rename
    • Better CI Pipeline
    • Test Refactor
    • Fastchess UCI test
    • Benchmark harness

I’ll probably split some of that out to a phase 3, but I don’t know what yet. The UCI test from fastchess is a real windfall, so I definitely want to get that going quickly, but it’s probably the most ‘phase-3’-y of the bunch. The list is in rough order, but I rarely work in order.