User:DroneBetter

From LifeWiki
Revision as of 19:05, 18 December 2022 by DroneBetter (talk | contribs) (Add additional part about bit/bytewise OT/INT simulator (that I had forgotten the first time))
Jump to navigation Jump to search

I mainly make minor corrections here, but also occasionally peruse Catagolue and add information here about things I find there (which is easy because quite a lot seems to be overlooked).

I began programming in Scratch, and made a real-time raytracer (supporting Newtonian lower speeds of light and gravitational lensing) before moving onto Python, in which I have written a tablebase program. One of its purposes is generating, rendering and "optimising" state transition diagrams of chess endgames in 3D (with springs and repulsion), it has a mode for exhaustive oscillator searches in bounded regions (unfortunately only feasibly up to 5*5) in cellular automata (currently only INT rules without b0) and using its 3D engine for state transition diagrams (like the Wolfram demonstration except they are 2D states in a 3D space instead of 1D and 2D), it takes quadratic time to simulate physics because it doesn't have a fast multipole method implementation. It supports topological manifolds (in both chess and CA) but only reduces the number of states to search by considering only those nonequivalent under symmetry, not vertex-transitivity (as is allowed by some manifolds). Here is the discussion thread :-)

Its purposes for chess, though less elementary, are also related to the broader study of recursive application of simple functions (albeit on finite graphs instead of infinite planes), that give rise to phenomena like the KRvK DTM distribution with respect to board width. The question "How many nonequivalent positions on an n*n board are checkmate in k half-moves" is only computable as a finite polynomial with respect to n for k<=3, after which the only fitting polynomials for the known terms exceed degree 6, which is the maximum it can be without growing faster than the number of states (though I haven't computed it very far yet so don't know whether any could be like the number of nonequivalent positions of two kings of different colours, which has a quadratic difference polynomial).

The cellular automaton mode was initially implemented trivially, with each state being a list of booleans (because then I could reuse the cached king moves which worked with manifolds instead of reimplementing anything), until my dear friend Redstoneboi (from the forums here) told me about David Buchanan's Github gist, gzip_swar_life.py, which simulates Life with "(Single-Instruction Multiple-Data) Within A Register" (a recursive initialisation), the SWAR because it represents bounded states as integers with four bits per cell so that its computations with bitwise operators can be done in the underlying C implementation (with a constant amount of Python interpreter overhead), the gzip is because it pretends its output is compressed so that gzip's decompression to eight bits per cell converts it to a YUV4MPEG video (which can be streamed at 1080p60fps, or 124416000 cells/second (!!)). I decided to begin modifying it for my program, to add support for arbitrary OT rules (and INT ones in 9 bits per cell (in 3*3 squares) then 8 (in 8*1 rectangles) after I realised it can check its own state in the same manner as the original program, which will allow video streaming without the intermediate gzip), and to add topological manifolds (reversing the bit order on scrolled edges in logarithmic time) and preliminary support for infinite planes, by exporting the state to an RLE, rescaling the board to have one-cell margins and reimporting the state (extremely inefficiently, but still pretty quickly, for small patterns on my machine), gzip_swar_isotropic_non-totalistic, also detailed in my forum thread.

I have become quite busy with real-life work as of late, however, so cannot do so much recreational programming for the time being.