qfind - a spaceship search program
Re: qfind - a spaceship search program
i was invited to outline a method to halve the lookup tables
the idea is basically the same as scourge. instead of storing the whole lookup table for solutions x such that r1 r2 x evolves into r3, you only store the first L+1 bits, and enforce the first L evolution constraints, and make another lookup table where you store the last W-L+1 bits and enforce the last W-L evolution constraints
then to look up a full width r1 r2 r3 you look up their respective halves and take the pairs of x that share the same center 2 bits, since they can be spliced together into a row that satisfies all evolution constraints
this is already pretty much implemented in qfind with lowbit/highbit during makerow, but would need a lot of changing of lookahead
my code is here https://gitlab.com/terezi/scourge/-/blo ... type=heads i couldn't get it to be faster than SAT at width 22ish, but it might be a poor lookahead implementation
the idea is basically the same as scourge. instead of storing the whole lookup table for solutions x such that r1 r2 x evolves into r3, you only store the first L+1 bits, and enforce the first L evolution constraints, and make another lookup table where you store the last W-L+1 bits and enforce the last W-L evolution constraints
then to look up a full width r1 r2 r3 you look up their respective halves and take the pairs of x that share the same center 2 bits, since they can be spliced together into a row that satisfies all evolution constraints
this is already pretty much implemented in qfind with lowbit/highbit during makerow, but would need a lot of changing of lookahead
my code is here https://gitlab.com/terezi/scourge/-/blo ... type=heads i couldn't get it to be faster than SAT at width 22ish, but it might be a poor lookahead implementation
- CARuler
- Posts: 1337
- Joined: July 30th, 2024, 5:38 pm
- Location: A rule-verse in floor rule-verse of the CGOL skyscraper
Re: qfind - a spaceship search program
can someone tell me how to make qfind upload to catagolue
likes interesting rules
vist my rules here
also likes weird growth patterns in CA
hyperbolic CA!!!
ADHD user
mostly inactive
vist my rules here
also likes weird growth patterns in CA
hyperbolic CA!!!
ADHD user
mostly inactive
Re: qfind - a spaceship search program
It would be helpful if you could give more detail on what your goal is here, but qfind cannot upload to catagolue directly. You would instead need to run the output through apgsearch. Note that if you use the dump feature, you can get a list of partial results from a loaded dump file using the preview feature. Use the "--help" option in qfind to see the full list of options.
Edit: (unrelated note to self) trying to load a saved state from the following search in v2.4b causes a segfault:
Code: Select all
./qfind -r B2cen3aj4ai5aj6i/S1e2eik3enr4iq5i -w 5 -v c/8 -s a -t 3 -q 16 --dump-interval 1-Matthias Merzenich
- confocaloid
- Posts: 6697
- Joined: February 8th, 2022, 3:15 pm
- Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms
Re: qfind - a spaceship search program
In short, that could be done by compiling apgsearch separately, choosing something like "qfind_stdin_test" as the destination census name, and then running qfind with the output piped into apgsearch.
Here is what I did to find p3 orthogonal c/3 spaceships in the B38/S23 CA, using qfind with "-s odd -w 9".
No warranty express or implied.
Note: if you want to actually submit the spaceships (as I did) then remove the part " -t 1 " in the last invocation. Otherwise, it will just save a log file locally (which you will be able to open with a text editor and view the apgcodes) and quit without submitting anything.
Code: Select all
# mkdir test
# cd test
# git clone https://github.com/Matthias-Merzenich/qfind.git
# cd qfind
# gcc qfind.c -O3 -fopenmp -march=native -o qfind
# cd ..
# git clone https://gitlab.com/apgoucher/apgmera.git --recursive
# cd apgmera
# ./recompile.sh --rule b38s23 --symmetry qfind_stdin_test
# cd ..
# ./qfind/qfind -r B38/S23 -v c/3o -s odd -w 9 | ./apgmera/apgluxe -t 1 -L 1 -n 10000 -i 0
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
Re: qfind - a spaceship search program
I found a strange bug in qfind v2.4b. With this command (or any command with a similar rule and this combination of speed, symmetry and width):
The output is:
The partial diplayed at the end is always corrupt.
I compiled qfind on Windows with gcc 13.2.0 and mingw-w64, using the command given in readme.txt.
Code: Select all
qfind -r B2ek3cij4ci/S2ce -v 2c/5 -s o -w 4Code: Select all
qfind v2.4b by Matthias Merzenich, 13 September 2024
Input: qfind -r B2ek3cij4ci/S2ce -v 2c/5 -s o -w 4
Rule: B2ek3cij4ci/S2ce
speed: 2c/5
Width: 4
Symmetry: odd
Dump interval: 1800 seconds
Dump mode: overwrite
Queue size: 2^20
Hash table size: 2^20
Minimum deepening increment: 3
Cache memory per thread: 32 megabytes
Number of threads: 1
08/05/25 11:32:36 Starting search
08/05/25 11:32:36 Search complete.
0 spaceships found.
Maximum depth reached: 9
Longest partial result:
P¯‗;I compiled qfind on Windows with gcc 13.2.0 and mingw-w64, using the command given in readme.txt.
- confocaloid
- Posts: 6697
- Joined: February 8th, 2022, 3:15 pm
- Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms
Re: qfind - a spaceship search program
Confirmed on Ubuntu with each of the following commands:
Code: Select all
# ./qfind -r B2ek3cij4ci/S2ce -v 2c/5 -s o -w 4
# ./qfind -r B2ek3cij4ci/S2ce -v 2c/7 -s o -w 5
# ./qfind -r B2ek3cij4ci/S2ce -v 3c/7 -s o -w 5
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
-
AforAmpere
- Posts: 1404
- Joined: July 1st, 2016, 3:58 pm
Re: qfind - a spaceship search program
Also happens on v2.3 with the corresponding command, and width 4 or 5:
Code: Select all
qfind v2.3 by Matthias Merzenich, 19 March 2023
Input: ./qfind -r B2ek3cij4ci/S2ce -p 5 -y 2 -s o -w 5
Rule: B2ek3cij4ci/S2ce
Period: 5
Offset: 2
Width: 5
Symmetry: odd
Queue size: 2^20
Hash table size: 2^20
Minimum deepening increment: 3
Cache memory per thread: 32 megabytes
Number of threads: 1
08/05/25 21:56:27 Starting search
08/05/25 21:56:27 Search complete.
0 spaceships found.
Maximum depth reached: 10
Longest partial result:
��,0^Re: qfind - a spaceship search program
I've known about this bug for a long time, and it only seems to occur when the search finishes at an extremely shallow depth with no spaceships found. I suspect this is a result of printing the pattern buffer before it's been written. I intend to fix it eventually, but I consider it a low priority. Let me know if you find an example search where it occurs for a longer final partial.vilc wrote: ↑May 8th, 2025, 5:47 amI found a strange bug in qfind v2.4b. With this command (or any command with a similar rule and this combination of speed, symmetry and width):The output is:Code: Select all
qfind -r B2ek3cij4ci/S2ce -v 2c/5 -s o -w 4The partial diplayed at the end is always corrupt.Code: Select all
... 0 spaceships found. Maximum depth reached: 9 Longest partial result: P¯‗;
I compiled qfind on Windows with gcc 13.2.0 and mingw-w64, using the command given in readme.txt.
-Matthias Merzenich
Re: qfind - a spaceship search program
Correct. Valgrind confirms that patternBuf is used before assignment:
Code: Select all
$ valgrind ./qfind -r B2ek3cij4ci/S2ce -v 2c/5 -s o -w 4
.
.
09/05/25 22:50:36 Starting search
09/05/25 22:50:36 Search complete.
0 spaceships found.
Maximum depth reached: 9
Longest partial result:
==22532== Conditional jump or move depends on uninitialised value(s)
==22532== at 0x484ED19: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==22532== by 0x48EDD30: __vfprintf_internal (vfprintf-internal.c:1517)
==22532== by 0x48D779E: printf (printf.c:33)
==22532== by 0x114A0F: finalReport (common.h:3069)
==22532== by 0x116F2B: main (qfind.c:501)
Code: Select all
3068 if (params[P_LONGEST] && aborting != 3){ /* aborting == 3 means we reached ship limit */
3069 if (patternBuf) printf("Longest partial result:\n\n%s",patternBuf);
3070 else printf("No partial results found.\n");
Code: Select all
$ gdb qfind
.
Reading symbols from qfind...
(gdb) watch patternBuf
Hardware watchpoint 1: patternBuf
(gdb) run -r B2ek3cij4ci/S2ce -v 2c/5 -s o -w 4
Starting program: /home/frank/Documents/GOL/qfind/qfind -r B2ek3cij4ci/S2ce -v 2c/5 -s o -w 4
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
qfind v2.4b by Matthias Merzenich, 21 September 2024
Input: -r B2ek3cij4ci/S2ce -v 2c/5 -s o -w 4
.
09/05/25 23:02:36 Starting search
Hardware watchpoint 1: patternBuf
Old value = 0x0
New value = 0x55555556d8b0 "\340\254\341\367\377\177"
0x000055555555a314 in bufferPattern (b=3, pRows=0x0, nodeRow=0, lastRow=0, printExpected=0) at /home/frank/Documents/GOL/qfind/common.h:944
944 patternBuf = (char*)malloc(((2 * MAXWIDTH + 4) * sxsAllocRows + 300) * sizeof(char));
(gdb) continue
Continuing.
09/05/25 23:03:06 Search complete.
0 spaceships found.
Maximum depth reached: 9
Longest partial result:
����[Inferior 1 (process 23201) exited normally]
(gdb)
The most pragmatic way to fix this bug is by allocating the buffer using calloc. This fills the buffer with zeroes, which happen to be string terminators. Any subsequent call to a printf-like function with an uninitialized patternBuf as argument prints a null-string with length 0 instead of some random junk.
Frank Everdij
Re: qfind - a spaceship search program
I have put qfind into visual studio code. How do I run it with an input? How do I run it in a different rule?
mmmmmmmmm, I love eating spaceships.
Re: qfind - a spaceship search program
Are you using Windows and trying to compile from the source code? In that case I would highly recommend compiling qfind under Windows Subsystem for Linux instead. It also compiles fine using MinGW-w64. As I recall, qfind would need a very slight modification to compile with Visual Studio, because VS is a stickler for something regarding OpenMP (I can't remember the details at the moment). I think it compiles with clang with some warnings which I intend to address at some point.
Please let me know if you have any difficulty with this or if you have any further questions.
Also, I moved your post to the qfind discussion thread.
-Matthias Merzenich
Re: qfind - a spaceship search program
I am trying to do the exact same thing, funnily, so this is very helpful. I am going to try using MinGW-w64 to use it now.Sokwe wrote: ↑August 18th, 2025, 4:36 amSince you mention Visual Studio, I assume you're using Windows and trying to compile from the source code. In that case I would highly recommend compiling qfind under Windows Subsystem for Linux instead. As I recall, qfind would need a very slight modification to compile with Visual Studio, because VS is a stickler for something regarding OpenMP (I can't remember the details at the moment). It also compiles fine using MinGW-w64.
Please let me know if you have any difficulty with this or if you have any further questions.
Also, I moved your post to the qfind discussion thread.
Please help me prove b3s23-a5 omniperiodic!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Re: qfind - a spaceship search program
Sorry, I'm having a bit of trouble understanding. Are you using Windows? If so, is there a problem with using Windows Subsystem for Linux?
-Matthias Merzenich
Re: qfind - a spaceship search program
Yes, I do use windows, but I use a thinkpad laptop.
erm, how do I use mingw-w64 to compile qfind?
Please help me prove b3s23-a5 omniperiodic!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Re: qfind - a spaceship search program
Again, I would primarily recommend using Windows Subsystem for Linux. However, you can install MinGW-w64 by following the instructions here. You can then open a terminal in your qfind folder and run the installation command given in the qfind readme:
Code: Select all
gcc qfind.c -O3 -fopenmp -march=native -o qfind-Matthias Merzenich
Re: qfind - a spaceship search program
I read the instruction page, but I cannot find the 'bin' folder inside mingw-w64. I downloaded it here. What is this version's equivalent of the 'bin' folder?
Please help me prove b3s23-a5 omniperiodic!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Re: qfind - a spaceship search program
You seem to have downloaded only the source code. What you need is either pre-built binaries or an installer. One source of pre-built binaries is from the link given in the tutorial. Other sources are available in the "pre-built toolchains" section of this webpage.
Another way to install gcc is to first install MSYS2, and then use the MSYS2 package manager to install gcc, although I've never done this myself, so I can't give further advice.
And again, I recommend Windows Subsystem for Linux (WSL2) first. I created the MinGW-w64 tutorial for those who, for whatever reason, couldn't use WSL2.
-Matthias Merzenich
Re: qfind - a spaceship search program
I do not have administrator rights, which is why I am trying to use MinGW-w64. Also, do I not need the source code that I downloaded?Sokwe wrote: ↑August 19th, 2025, 3:24 amYou seem to have downloaded only the source code. What you need is either pre-built binaries or an installer. One source of pre-built binaries is from the link given in the tutorial. Other sources are available in the "pre-built toolchains" section of this webpage.
Another way to install gcc is to first install MSYS2, and then use the MSYS2 package manager to install gcc, although I've never done this myself, so I can't give further advice.
And again, I recommend Windows Subsystem for Linux (WSL2) first. I created the MinGW-w64 tutorial for those who, for whatever reason, couldn't use WSL2.
Please help me prove b3s23-a5 omniperiodic!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Re: qfind - a spaceship search program
No, you do not need the source code. Instead, I recommend following the instructions in the tutorial exactly as they are written. If you have any trouble with this or any further questions, please let me know. You might also want to install Git Bash (see the previous section in the tutorial).
Edit: if you get it working, please give this post a like.
-Matthias Merzenich
Re: qfind - a spaceship search program
I installed minGW-w64, put it on the path, compiled the file, I did everything. but after all that, 'your administrator has caused windows security to block this action' ughhhh whyyyyySokwe wrote: ↑August 19th, 2025, 4:27 amNo, you do not need the source code. Instead, I recommend following the instructions in the tutorial exactly as they are written. If you have any trouble with this or any further questions, please let me know. You might also want to install Git Bash (see the previous section in the tutorial).
Edit: if you get it working, please give this post a like.
Please help me prove b3s23-a5 omniperiodic!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Re: qfind - a spaceship search program
Are you using a administrator account?
Code: Select all
x = 31, y = 13, rule = C
8.2X2.3X.3X.X.X$8.X.X.X3.X3.X.X$8.X.X.3X.3X.X.X$8.2X2.X5.X.X.X$8.X.X.
3X.3X.3X$M2.M$4.M$M3.M$.4M$27.2M$27.M.M$29.M$29.2M! [[ AUTOSTART GPS 10 ]]
Re: qfind - a spaceship search program
I do not have administrator rights on this device.
Please help me prove b3s23-a5 omniperiodic!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Please visit my ruleset and contribute!
User:ThePlayzr
Finally got LLS! Time to do way too much searching!
Re: qfind - a spaceship search program
Can you contact your administrator?
Also, are you actually allowed to install qfind on that device?
What are you doing to cause the ‘your administrator has caused windows security to block this action' message?
Code: Select all
x = 31, y = 13, rule = C
8.2X2.3X.3X.X.X$8.X.X.X3.X3.X.X$8.X.X.3X.3X.X.X$8.2X2.X5.X.X.X$8.X.X.
3X.3X.3X$M2.M$4.M$M3.M$.4M$27.2M$27.M.M$29.M$29.2M! [[ AUTOSTART GPS 10 ]]
Re: qfind - a spaceship search program
Can you give any more details? What are the exact steps you take that cause the error? Does the error say anything more than "your administrator has caused windows security to block this action"?
-Matthias Merzenich
Re: qfind - a spaceship search program
I'm not really finished with qfind v2.4, but I haven't worked on it in almost a year, and in light of the above questions I decided I should at least provide a portable Windows executable for the latest version.
Here is a zip archive containing a Windows executable for x86-64 CPUs: This was compiled under MinGW-w64 with the MSVCRT runtime library using the following command:
If anyone has any trouble getting this to work on their machine, please let me know.
I'm curious to know if there's a desire or need for a pre-compiled Windows executable for ARM64 CPUs. I don't actually know anything about cross-compiling for the ARM64 architecture, but if there's interest I wouldn't mind giving it a shot.
Here is a zip archive containing a Windows executable for x86-64 CPUs: This was compiled under MinGW-w64 with the MSVCRT runtime library using the following command:
Code: Select all
gcc qfind.c -static -O3 -fopenmp -march=x86-64 -o qfindI'm curious to know if there's a desire or need for a pre-compiled Windows executable for ARM64 CPUs. I don't actually know anything about cross-compiling for the ARM64 architecture, but if there's interest I wouldn't mind giving it a shot.
-Matthias Merzenich