1Hz CPU made in Minecraft running Minecraft at 0.1fps [video]
youtube.com
youtube.com
The program itself was written in an existing intermediate language called URCL, which was then compiled to CHUNGUS2 assembly. CHUNGUS2 is the processor made with Minecraft's redstone mechanics. The processor was emulated for development, but the demo is running on MCHPRS, a Minecraft server that uses Wasmtime's Cranelift to JIT the redstone operations, which are represented as a weighted directed graph. Before MCHPRS, optimizing redstone performance using compiler techniques was not thought to be possible. With MCHPRS the demo takes 9 hours to run, it would take decades using Minecraft.
https://github.com/sammyuri/minecraft
https://github.com/MCHPR/MCHPRS
As for CHUNGUS2 itself, it's a proper RISC processor, it has a 4-stage instruction pipeline, 64 byte 8-way associative data cache, even branch prediction.
Ok, to clarify, is MCHPRS a functioning Minecraft Server that can support a player logging in and mining? This story is seeming a lot more like "A 1Hz CPU made on something that has mechanical similarities to Minecraft".
MCHPRS just takes out what the computer doesn't use and optimizes the simulation of it.
I would call that a computer running in minecraft, but you could argue either way.
is it CPU or GPU dependent,
Can it be "sharded" and run on multiple machines in cloud?
To my understanding, this is almost a pure CPU task, like how normal minecraft currently works. Which would actually make sharding a little easier if they implemented it (sounds like they haven't).
The GPU is an interesting point though. There's probably a ton of simple matrix multiplying in the machine's design that could benefit from a GPU.
When emulating software in software, it's much easier to confirm that the exact same operations are done, and you can in some cases fully verify the solution.
They created a virtual machine with a custom instruction set. Why wouldn't an optimized JIT work?
Unless your CPU is esoteric enough for mob mechanics or otherwise to be useful :).
How many layers of abstraction is that in total, including (probable virtualization > VM OS > JVM)?
I will die on that hill.
Comment from one of the creators;
This build does NOT run in real time. It runs on MCHPRS, the server developed by StackDoubleFlow, which speeds up the game roughly 10-20,000x while running redstone. That brings the framerate to a much more reasonable 0.1fps, so the long timelapses in the video only took 9 hours to record in in total.
It really saddens me that their post was removed from r/Minecraft, for crediting a server by including its IP address for literally one second in the video.
At least one can find niche communities with healthy discussion/debate as primary interest.
Soon to be official policy based on their statements at the moderator convention:
"I want our users, user-users and moderator users, to make money on reddit. Specifically, I want them to make money from other users. And so we need to have business models where users are paying money to other users or to subreddits. I would like subreddits to have the ability to be businesses. We have a lot of subreddits that are kind of trying to do this, but the platform just doesn't support it."
It's especially weird becuase in the last year or two reddit has cranked their capricious and opaque moderation up to 11-- it would be suicidal to base your livelihood on that platform where you could be shut off at an instant and without recourse just due to a false report campaign from a competitor, troll, or extortionist.
The whole thing was real slow, but it was so much fun trying to design something that would perform interesting calculations. I stopped working on it as at the time Minecraft had some odd bugs with pistons that would cause non-deterministic behavior.
I think the most challenging aspect wasn't the programming or circuits, which were well understood and mapped out, but trying to create modules I could copy-paste inside a special Minecraft save editor to make the machine quickly, then manually dragging out data/command lines to hook the modules together.
> 3D Minecraft in Minecraft with no command blocks, no datapacks and no mods. Features include an 8x8x8 fully 3D-rendered world with 16 different block types, 32 different items, and dozens of game mechanics including mining, crafting, smelting, building, chests, random ticks
Is "3D Minecraft" a Minecraft clone for low-powered hardware? It looks like their emulated CPU only has <10KB RAM and a 96x64 display, which screams "TI-83 program" to me.
I think they specify "3D Minecraft" to distinguish it from earlier efforts, where people built 2D Minecraft-like experiences with redstone, like:
https://www.gamesradar.com/guy-makes-minecraft-playing-compu...
It's even more impressive than that. It has 8kb of ROM, and only 512 bytes of RAM!
See Greg Egan's PERMUTATION CITY for more on that.
Thank you HN!
If it's about building physical things rather than virtual things, consider Lego Mindstorms controllers; you can build digital logic in them using Scratch...and graduate to Python when he gets frustrated with the limitations. And there's tons of Minecraft-themed Lego contraptions, he could theoretically use Mindstorms logic, lights, and actuators to build Redstone logic!
I'm kinda clumsy but I get a lot of pleasure out of breadboarding with 74xx parts.
Sometimes I think I want to make a frame buffer out of 74xx parts and some SRAM.
https://www.youtube.com/watch?v=LU5989eVRZs
because that kind of system competes with Raspberry Pi which puts a lot of downward pressure on what is an "acceptable" price.
Real 8-bitters used custom chips for their display controllers, but if you don't use custom chips you need a few handfuls of logic chips and you wind up with something about as expensive as the video card linked to above. To justify a custom chip you need big volume. You can make a display controller from an FPGA or Microcontroller, it's probably cheaper than one made from small chips, but still not cheap enough... And there's something absurd about using a much more powerful part than the CPU to run the display.
What a great project!
You can find more information in the explainer video https://youtu.be/xIMkqHb2-KM
I don't know much about Minecraft, but I assumed the CPU would be built purely from blocks which act like transistors. Yet there's a part of the video where the show code written in-game(?). What's up with that? Isn't it cheating?
Placing all those blocks by hand would be tedious.
I believe you are seeing a complier of code -> red stone, not code embedded into Minecraft.
(late edit: The file name is src/redpiler/mod.rs - a search brings up https://www.reddit.com/r/redstone/comments/md1xwy/redpiler_t... which is posted by the same author as the video creator... and that appears to be an optimized Redstone interpreter (terms get confusing here if you try to say that this is a that)...
> MCHPRS is an open source project with the goal of allowing high speed redstone execution. This speed was achieved by generating a graph structure of all redstone links. MCHPRS can compile redstone into a graph and execute based on it.
> This is what the generated graph looks like: https://imgur.com/a/J51nJvV
> Redpiler is just a proof of concept and I expect to be able to get much faster speeds in the future :D
/edit)
The code displayed at the beginning seems to come from that: https://github.com/MCHPR/MCHPRS/blob/master/crates/core/src/...
Thinking about this another way. Real world CPUs have clock speeds at least 1 billion times faster than this and they only run Minecraft a few 1000 times faster than is claimed here. How do these numbers add up?
> This build does NOT run in real time. It runs on MCHPRS, the server developed by StackDoubleFlow, which speeds up the game roughly 10-20,000x while running redstone. That brings the framerate to a much more reasonable 0.1fps, so the long timelapses in the video only took 9 hours to record in total.
Basically you go from building logic circuits to building your own CPU and writing assembly for it.
I only added it to my wishlist, didn't try it yet.
There is a good https://nandgame.com/
You may want to use some simulating software like a verilog interpreters or logic simulators. I do not know a good one, I'm not a specialist it that stuff.
And... If you have a couple of months to waste... You can try Factorio.
I would also start with Code by Charles Petzold
In this case, they got a rude answer anyway. I hardly think that's their fault though.
If you skip back to the first question, then. It isn't naive. You chose to be short when you could have said nothing.
> KiCad is a free software suite for electronic design automation (EDA). It facilitates the design and simulation of electronic hardware. It features an integrated environment for schematic capture, PCB layout, manufacturing file viewing, SPICE simulation, and engineering calculation. Tools exist within the package to create bill of materials, artwork, Gerber files, and 3D models of the PCB and its components.
https://www.kicad.org/discover/spice/ :
> KiCad integrates the open source spice simulator ngspice to provide simulation capability in graphical form through integration with the Schematic Editor.
PySpice > Examples: https://pyspice.fabrice-salvaire.fr/releases/v1.6/examples/i... :
+ Diode, Rectifier (AC to DC), Filter, Capacitor, Power Supply, Transformer, [Physical Relay Switche (Open/Closed) -> Vacuum Tube Transistor -> Solid-state [MOSFET,]] Transistor,
From the Ngspice User's Manual https://ngspice.sourceforge.io/docs/ngspice-37-manual.pdf :
> Ngspice is a general-purpose circuit simulation program for nonlinear and linear analyses.*
> Circuits may contain resistors, capacitors, inductors, mutual inductors, independent or dependent voltage and current sources, loss-less and lossy transmission lines, switches, uniform distributed RC lines, and the five most common semiconductor devices: diodes, BJTs, JFETs, MESFETs, and MOSFETs.
> [...] Ngspice has built-in models for the semiconductor devices, and the user need specify only the pertinent model parameter values. [...] New devices can be added to ngspice by several means: behavioral B-, E- or G-sources, the XSPICE code-model interface for C-like device coding, and the ADMS interface based on Verilog-A and XML.
Turing completeness: https://en.wikipedia.org/wiki/Turing_completeness :
> In colloquial usage, the terms "Turing-complete" and "Turing-equivalent" are used to mean that any real-world general-purpose computer or computer language can approximately simulate the computational aspects of any other real-world general-purpose computer or computer language. In real life this leads to the practical concepts of computing virtualization and emulation. [citation needed]
> Real computers constructed so far can be functionally analyzed like a single-tape Turing machine (the "tape" corresponding to their memory); thus the associated mathematics can apply by abstracting their operation far enough. However, real computers have limited physical resources, so they are only linear bounded automaton complete. In contrast, a universal computer is defined as a device with a Turing-complete instruction set, infinite memory, and infinite available time.
Church–Turing thesis: https://en.wikipedia.org/wiki/Church%E2%80%93Turing_thesis ... Lamda calculus (Church): https://en.wikipedia.org/wiki/Lambda_calculus
HDL: Hardware Description Language > Examples: https://en.wikipedia.org/wiki/Hardware_description_language#...
HVL: Hardware Verification Language: https://en.wikipedia.org/wiki/Hardware_verification_language
awesome-electronics > Free EDA Packages: https://github.com/kitspace/awesome-electronics#free-eda-pac...
https://github.com/TM90/awesome-hwd-tools
EDA: Electronic Design Automation: https://en.wikipedia.org/wiki/Electronic_design_automation
Quantum complexity theory https://en.wikipedia.org/wiki/Quantum_complexity_theory#Back... :
> A complexity class is a collection of computational problems that can be solved by a computational model under certain resource constraints. For instance, the complexity class P is defined as the set of problems solvable by a Turing machine in polynomial time. Similarly, quantum complexity classes may be defined using quantum models of computation, such as the quantum circuit model or the equivalent quantum Turing machine. One of the main aims of quantum complexity theory is to find out how these classes relate to classical complexity classes such as P, NP, BPP, and PSPACE.
> One of the reasons quantum complexity theory is studied are the implications of quantum computing for the modern Church-Turing thesis. In short the modern Church-Turing thesis states that any computational model can be simulated in polynomial time with a probabilistic Turing machine. [1][2] However, questions around the Church-Turing thesis arise in the context of quantum computing. It is unclear whether the Church-Turing thesis holds for the quantum computation model. There is much evidence that the thesis does not hold. It may not be possible for a probabilistic Turing machine to simulate quantum computation models in polynomial time. [1]
> Both quantum computational complexity of functions and classical computational complexity of functions are often expressed with asymptotic notation. Some common forms of asymptotic notion of functions are \Omega(T(n)) and \Theta(T(n)).
> \Theta(T(n)) expresses that something is bounded above by cT(n) where c is a constant such that c>0 and T(n) is a function of n, \Omega(T(n)) expresses that something is bounded below by cT(n) where c is a constant such that c>0 and T(n) is a function of n, and \Theta(T(n)) expresses both O(T(n)) and \Omega(T(n)). [3] These notations also their own names. O(T(n)) is called Big O notation, \Omega(T(n)) is called Big Omega notation, and \Theta(T(n)) is called Big Theta notation.
Quantum complexity theory > Simulation of quantum circuits https://en.wikipedia.org/wiki/Quantum_complexity_theory#Simu... :
> There is no known way to efficiently simulate a quantum computational model with a classical computer. This means that a classical computer cannot simulate a quantum computational model in polynomial time [P]. However, a quantum circuit of S(n) qubits with T(n) quantum gates can be simulated by a classical circuit with O(2^{S(n)}T(n)^{3}) classical gates. [3] This number of classical gates is obtained by determining how many bit operations are necessary to simulate the quantum circuit. In order to do this, first the amplitudes associated with the S(n) qubits must be accounted for. Each of the states of the S(n) qubits can be described by a two-dimensional complex vector, or a state vector. These state vectors can also be described a linear combination of its component vectors with coefficients called amplitudes. These amplitudes are complex numbers which are normalized to one, meaning the sum of the squares of the absolute values of the amplitudes must be one. [3] The entries of the state vector are these amplitudes.
Quantum Turing machine: https://en.wikipedia.org/wiki/Quantum_Turing_machine
Quantum circuit: https://en.wikipedia.org/wiki/Quantum_circuit
Church-Turing-Deutsch principle: https://en.wikipedia.org/wiki/Church%E2%80%93Turing%E2%80%93...
Computational complexity > Quantum computing, Distributed computing: https://en.wikipedia.org/wiki/Computational_complexity#Quant...
A fun thought experiment is whether you could ever imagine that block build growing complex enough and becoming intelligent.
If AI can become intelligent (generally, i.e. GAI), then it could be implemented with redstone. If human level intelligence requires something more, then it can not, and the search for redstone 2.0 continues…
It's not so much overhead that's killing technology for me atm, it's dumb decisions/terrible technoshit.
Like Google's Nest products that randomly disconnect from wifi and refuse to reconnect. How do you fuck up connecting to wifi in 2022?
But this! This is like sending a person to mars!
And I have the same question for the geniuses who did this that I have for the ones working on that:
Aren’t there cures for cancer and perovskite solar cells to discover? Why are you using your excellent minds, and apparently enormous amount of free time, building cool but very slow virtual computers out of virtual sand, when you could be proving the smoothness of the Navier–Stokes equations?
It’s one thing, to my mind, when athletes climb huge mountains because they’re there. It’s quite another, again, to me, when obvious genius goes to waste.
There. I feel better for having said it. I only wish I could say it to Elon Musk re Mars, and get my son to spend a fifth as much time on his math homework as he does playing minecraft. This incredibly cool hack is just going to exacerbate the situation! :-)
If you're not trolling, you need to seriously step back, and think about how play=learning, how any scientific research=benefits us all.
Going to Mars is not good?! A waste?! There is so much wrong with this thought alone, so much broken logic, that it is horrifying to me.
A project such as going to Mars, will yield immense scientific research and output, benefiting humanity as a whole.
Just the r&d into material research alone, engineering, will benefit endless other disciplines.
It as if you see each thing as siloed, as if doing thing x, has zero benefit to y.
I wonder, do you employ this same logic for yourself? That is, you have no hobbies, nothing but work, and spend every moment working?
If you were a farmer, feeding thousands, would you be upset if you make bushes shapely at home, if you planted decorative plants?
I literally cannot view your comment in a positive light.
I’m not trolling. I really do disagree with this in good faith. You can get the same materials research etc benefits by doing something that directly benefits humankind. Also, I don’t think that Musk thinks that it’s the spin-off stuff that matters. He honestly and in good faith wants to expand humans to another planet. He’s said this innumerable times. I just disagree that anything anyone feels like doing is as valuable as anything else. There are value decisions involved. I’m not saying that anyone should be enjoined or forced or any such thing. But maybe enticed?
The type of thought process you are employing is not good for humanity. If we followed your thought process, we would still be in caves.
Sammyuri's interest and focus is microprocessor design. I'm sure he has a future in it (as far as I understand he's fairly young). Curing cancer isn't something he's likely to be good at, but who knows, maybe the chips he helps design will help with it one day. Doing this thing which no one has done before, has surely given him unique perspectives on a lot of things (as well as a lot of knowledge about CPU architecture most of us don't have). Maybe he will combine it with other knowledgeable people's unique perspectives and make wondrous discoveries.
Or he might do none of that, and just inspire a lot of other people to go down that path.
Don't think of intelligence as something that can exist in a vacuum. Let Sammyuri be Sammyuri.
Because in the real world there are people in power who do not want those things to happen, unless it disproportionately benefits them at the expense of the people actually doing the work.
In Minecraft there are no busy bodies, gate keepers, monopolists, financial institutions or regulations preventing people from doing peaceful intellectual activities. The certification necessary to become a computer scientist takes 16 years, in Minecraft you don't need any certification you can just do it on day one.
The other reason is that building a computer in redstone isn't that impressive, it is like building your own computer in a CS course which has been done over and over again by many students.
@dang can you update this post to link to the video?