149 points · by ibobev · 2w ago · 34 comments
I got curious about how well it would perform if ported to C#, as I've been getting some great results porting and optimizing C/C++/Rust code to C# lately.
If you're interested, here's my take (built with Sonnet 5.5):
https://github.com/theolivenbaum/soksolv
Took some ideas on optimizing memory usage from chess solvers. Probably applies to the original Go code if you want to port it upstream.
The benchmark is still running, but the results so far look quite promising:
Go: Solved 1,927 in 1269s
C#: Solved 2,365 in 382s
The timings are for boards solved by both, and so far the C# version is showing roughly a 3x speedup over the Go implementation, while also solving more boards (running for a 10s time limit - I'll run it afterwards matching the 20s time limit to see).
So, quite a lot more complex than one might think.
I'm assuming P != NP (and NP != PSPACE).
I am also not an expert on complexity theory.
But intuitively: if you try to work with these two types of problems, you find that NP-complete problems are way more amenable to _pretty good_ solutions. There are very effective SAT solvers out there, and ILP solvers. Finding a TSP solution on almost any graph on tens of thousands of nodes is quite easy, and making good adversarial instances is hard. There are many programming challenges around NP-complete problems online that attract effective solvers, e.g. PACE, and previously [:(] Google Hashcode. PSPACE-complete problems on the other hand feel really, really intractable, where even solving small instances is very difficult, and I think the article we're commenting on gives a good feeling for that.
For example, we know that LOGTIME is a subset of PTIME, which is a subset of NPTIME and PSPACE, both of which are a subset of EXPTIME. We also know that EXPTIME is strictly bigger than LOGTIME and PTIME.
So somewhere between PTIME, NP, PSPACE and EXPTIME, there must be a change in computational capability. We just don't know where.
This also exists between constant-depth circuit networks and algorithms using LOGSPACE. A circuit network of depth of log^2(input_size) can compute more than any nondeterministic LOGSPACE algorithm, which can compute more than a circuit network of constant depth using threshold gates. We also know that a deeper circuit network has strictly more computational power than the constant depth one.
But where is the specific jump in computational power? We don't know.
That makes the "practical applications" very strange to consider.
I keep jesting, the funniest resolution of P vs NP would be that P = NP, except it has a cost factor that stops any practical collapse, like a proven minimum of O(n^<number of atoms in the universe>). That'd be the most annoying resolution of them all.
Take sudoku. If I give you a difficult board, and also the solution, it is easy to verify that it is correct.
Small efficient certificates do not exist for PSPACE-complete problems. Indeed for Sokoban, some instances require exponentially long sequences of pushes to solve.
https://victorqribeiro.itch.io/qubes
I did released it for Android also, but it needs updating.
This caught me completely off-guard, and I was indeed skim reading. Nonetheless, very well written article!
And we will need strict rules on the human only solvers. The fun is lost when you lose to a solver written by a frontier agent swarm, while if a new solver written by a human outcompetes you, it feels all fair and square and you can go back to the drawing board.
Yes a human steered this solver, but it doesn’t feel the same competitively, like doped vs non doping athlete. Till 2026 we never had to think of this for cognitive tasks but the age to do so is coming now.
Maybe i will apply some of these heuristics myself when solving puzzles.
That's the spirit... :-D
The base building blocks you need to make this work:
- dataset
- unhackable success metric
- hardened, isolated f(dataset, solver) -> metric
- helps a ton but not required: human with strong intuitive domain understanding
This is exactly the kind of RL environment in which the models are forged, so they're truly excellent at basically all stages of this process.
I'm working on something similar for image and video compression. The SOTA approach for these things currently is mostly deep neural networks. But agent powered experiment factories let you cover FAR more ground in algorithm-space than before, which makes deterministic and explicit algorithms, with little or no heuristics (aka floating point weights) feasible once again.
Explicit algorithms (SGD) grew implicit ones (neural nets) that are more powerful and general, but also more opaque and less efficient. Now those implicit ones have made search over explicit algorithms vastly faster, which is making them increasingly competitive with neural methods.