Skip to content

Archives

Links for 2019-01-11

  • PRNG-predicting bot ascends in Nethack in 7 minutes 15 seconds

    This is a really amazing hack!

    So, we could now go from starting inventory to RNG-seed in no time, but we still had to ascend. While we could write a simple “wish”-bot, get +127 Magicbane and then ascend by hand from there, achieving both fastest realtime and lowest turn count in the same game would not be easy. First idea was to start a NAO game, fetch the seed, then saving and perfecting the seed offline. It was quickly ruled out though as the game is reseeded each time it is started (i.e. when you load your game). Loooong story short, we wrote a bot. You had to play the first turns (offline) and move her to a non-magic fountain located next to a wall. If you died, no big deal, just retry on the same seed. This is why SWAGGINZZZ stood still for 6 minutes, we had absolutely horrible RNG when trying to get the specific fountain needed on dlvl2. The fountain is required for wishes. The wall is required to be able to offset the random state without advancing the game state – every time the character attempts to walk into a wall, it calls random() without wasting any in-game time. From the fountain, the bot ascends completely on her own.

    (tags: nethack random prng games hacks cheats nao amazing)

  • glibc changed their UTF-8 character collation ordering across versions, breaking postgres

    This is terrifying:

    Streaming replicas—and by extension, base backups—can become dangerously broken when the source and target machines run slightly different versions of glibc. Particularly, differences in strcoll and strcoll_l leave “corrupt” indexes on the slave. These indexes are sorted out of order with respect to the strcoll running on the slave. Because postgres is unaware of the discrepancy is uses these “corrupt” indexes to perform merge joins; merges rely heavily on the assumption that the indexes are sorted and this causes all the results of the join past the first poison pill entry to not be returned. Additionally, if the slave becomes master, the “corrupt” indexes will in cases be unable to enforce uniqueness, but quietly allow duplicate values.
    Moral of the story — keep your libc versions in sync across storage replication sets!

    (tags: postgresql scary ops glibc collation utf-8 characters indexing sorting replicas postgres)