[HN Gopher] 1Hz CPU made in Minecraft running Minecraft at 0.1fp...
___________________________________________________________________
1Hz CPU made in Minecraft running Minecraft at 0.1fps [video]
Author : reimertz
Score : 368 points
Date : 2022-09-19 17:41 UTC (5 hours ago)
(HTM) web link (www.youtube.com)
(TXT) w3m dump (www.youtube.com)
| mesozoic wrote:
| Now make Minecraft in that Minecraft.
| cprecioso wrote:
| Any guesses on when we will get Factorio running on Factorio?
| Comevius wrote:
| Pretty cool.
|
| 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.
|
| https://www.youtube.com/watch?v=FDiapbD0Xfg
| acchow wrote:
| > Before MCHPRS optimizing redstone performance using compiler
| techniques was not thought to be possible.
|
| They created a virtual machine with a custom instruction set.
| Why wouldn't an optimized JIT work?
| [deleted]
| lifthrasiir wrote:
| To my knowledge, MCHPRS is not a full Minecraft server
| implementation; it only contains just enough subset of the
| game to run redstone circuits. The upside is that this subset
| can be run a lot faster than the full game server.
| causality0 wrote:
| _With MCHPRS the demo takes 9 hours to run, it would take
| decades using Minecraft._
|
| 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".
| spicybright wrote:
| Seems like splitting hairs. The redstone mechanics needed to
| run the computer are implemented exactly the same as the real
| game. The computer can be loaded into real minecraft and runs
| as expected.
|
| 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.
| __alexs wrote:
| Yes it is a real Minecraft server implementation you can
| connect a standard client to but it is not a vanilla survival
| implementation. It's a redstone sandbox.
| [deleted]
| [deleted]
| dexwiz wrote:
| Do people use circuit simulators and compile to blocks, or
| copy/paste units from previous projects? Seems like such a
| massive undertaking where a single misplaced item ruins
| everything.
| tablespoon wrote:
| The video description says:
|
| > 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.
| jcl wrote:
| Yeah, they're implementing a Minecraft-like experience within
| Minecraft, not literally running official Minecraft code on
| their VM.
|
| 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...
| derac wrote:
| They wrote a clone, yes.
| brap wrote:
| What's with the code?
|
| 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?
| kibwen wrote:
| As mentioned by others the Rust code shown in the video is for
| the Minecraft server implementation. But the game itself
| running on the in-game CHUNGUS 2 was written in another
| language, and then they have a custom assembler that translates
| that code into Minecraft blocks to be loaded as the 8kb ROM.
| MauranKilom wrote:
| Briefly put: The code shown was used to make the redstone (i.e.
| Minecraft logic circuit) behavior run at 10000x speed on the
| server. It's still the same game logic, but recording the video
| only took 9 hours instead of a decade.
| shagie wrote:
| A glance at the code, it appears to be the code for
| _generating_ the world.
|
| 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)
| ZeKK14 wrote:
| As explained in the description of the video, this is not
| running on a vanilla Minecraft server, but on their own
| implementation optimized to run redstone circuits.
|
| The code displayed at the beginning seems to come from that:
| https://github.com/MCHPR/MCHPRS/blob/master/crates/core/src/...
| [deleted]
| martin-adams wrote:
| I suspect that code is so they can duplicate the blocks and not
| have to build everything by hand. I don't think the code is
| used to execute minecraft.
| spullara wrote:
| The code generates the computer I think.
| SCLeo wrote:
| I think we will see more of these amazing Minecraft technical
| creations as people who played Minecraft as children are now
| finishing up their higher educations.
| PaulHoule wrote:
| My son has gotten into designing logic circuit with Redstone. I
| wish I could get him to do the same with 74xx/54xx parts.
| LeifCarrotson wrote:
| Why 74xx parts, other than nostalgia for an era that was over
| decades before he was born?
|
| 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!
| naikrovek wrote:
| 74xx parts are still made and used in new designs today...
| speed_spread wrote:
| Talk about gatekeeping...
| przemub wrote:
| _gate_ keeping. Get it? Ahahaha.....
| swores wrote:
| And yet you're talking about it despite replying to someone
| who clearly wasn't gatekeeping. They were offering
| suggestions.
| PaulHoule wrote:
| 74xx parts are real physical objects you can handle in your
| hands. You don't need to use a computer at all with them
| (though I often use an Arduino together with them)
|
| I'm kinda clumsy but I get a lot of pleasure out of
| breadboarding with 74xx parts.
| shagie wrote:
| Should get some 7404 chips as good luck charms.
| whatisthiseven wrote:
| I worked on a CPU in Minecraft years ago and designed it to be a
| 7-bit CPU. I chose that number because it gave me the an
| appreciable number of operations plus space for arguments. I had
| only 6 bytes of RAM and about 32bytes of ROM. The ROM was just a
| circle of transparent blocks (zero) and solid blocks (one) pushed
| around by pistons.
|
| 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.
| MauranKilom wrote:
| Brings me back to when I first worked on an ALU in Minecraft.
| At least at the time, it had really annoying bugs with
| repeaters though, where it would occasionally mess up a signal,
| which frustrated me enough to give up on it.
| twostorytower wrote:
| Incredible. Next do Minecraft in Minecraft in Minecraft.
| kleer001 wrote:
| Did you mean to link to the video?
| kibwen wrote:
| Don't miss the other video showing the overview of the CPU, it's
| seriously impressive: https://youtube.com/watch?v=FDiapbD0Xfg
| reimertz wrote:
| This is truly amazing.
|
| 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._
| sadjad wrote:
| Will it run Doom?
| dylan604 wrote:
| I don't know if I'm more impressed that a coffee maker can
| run Doom, that another game can run Doom from inside it like
| this, or that Doom is just this portable
| taneq wrote:
| I think my favourite was the recent "Doom can run Doom".
| quickthrower2 wrote:
| Also... will it run Docker?
| xerox13ster wrote:
| They said in the video they are going to run Doom on it at
| some point.
| hot_gril wrote:
| Also, is that redstone wiring non-vanilla, or is it just a
| texture pack?
| bmicraft wrote:
| It's just a texture pack
| dubiousconst281 wrote:
| It's mind blowing how much effort they put into this, the
| MCHPRS server even JIT compiles redstone into native code using
| Cranelift:
| https://github.com/MCHPR/MCHPRS/blob/master/docs/Redpiler.md
|
| 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.
| Yajirobe wrote:
| How did they load Minecraft onto that computer?
| MauranKilom wrote:
| They didn't load the real Minecraft on it, but they
| implemented their own version. But that version still has
| true 3D graphics, several block types, an inventory, mining,
| crafting, etc.
| jl6 wrote:
| And if that version has redstone, then we know what needs
| to happen next.
| moffkalast wrote:
| It's redstone all the way down.
| swayvil wrote:
| The 0.1fps time scale makes no difference to people living within
| this minecraft universe. From their perspective a second is a
| second and a day is a day. Funny.
|
| See Greg Egan's _PERMUTATION CITY_ for more on that.
| curious_tenet wrote:
| meta game of life lol
| pleb_nz wrote:
| Ha... It's not even a color display /s
| system2 wrote:
| I wish to have the patience and excitement about something to
| build like this. I admire people like this youtuber.
| boredpudding wrote:
| I wonder if it's possible to run this outside of Minecraft in
| some way. I assume the developers weren't debugging the program
| in Minecraft itself.
| miohtama wrote:
| They cannot naturally run real Minecraft on their CPU. Instead,
| they have handcoded Minecraft like game for their custom CPU,
| so the title is a bit misleading. For this CPU/language you
| will find an emulator.
|
| You can find more information in the explainer video
| https://youtu.be/xIMkqHb2-KM
| ravi-delia wrote:
| It's definitely a little misleading, but idea of running the
| entire JVM with graphics stack included is so insane that I'm
| willing to call this "minecraft in minecraft"
| reimertz wrote:
| Derp: here is the video link:
| https://www.youtube.com/watch?v=-BP7DhHTU-I
|
| @dang can you update this post to link to the video?
| dang wrote:
| Fixed now.
| Arbortheus wrote:
| This is incredible!
| unethical_ban wrote:
| How would someone get into designing/simulating CPUs and
| computers other than Minecraft? Is there any software for
| learning and implementing "simple" logic circuits, memory, etc?
| bismuthcrystal wrote:
| Sorry for being this rough but, what a naive question this is.
| Of course there is.
| Twisol wrote:
| In natural language, asking "is there" is implicitly asking
| for more than just a truth value. It's expected that the
| response will include an example; a witness to the answer
| "yes". The indirection is considered polite and non-
| aggressive by many people. In particular, a direct question
| like "What software exists for this?" is sometimes met with a
| "Have you tried Google?", when the intent is also to get
| _recommendations_ and not a pile of search results to
| evaluate as a newcomer.
|
| In this case, they got a rude answer anyway. I hardly think
| that's their fault though.
| unethical_ban wrote:
| It's expected that there are tools, clearly, since people
| seem to know how to do this kind of thing. _Good_ tools that
| an interested beginner can use as a lab are another thing.
|
| If you skip back to the first question, then. It isn't naive.
| You chose to be short when you could have said nothing.
| LelouBil wrote:
| Look at this game :
| https://store.steampowered.com/app/1444480/Turing_Complete/
|
| 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.
| inetknght wrote:
| Cool! Now build it in Turing Complete and export it to an FPGA
| deelowe wrote:
| For those wondering:
| https://store.steampowered.com/app/1444480/Turing_Complete/
| westurner wrote:
| From KiCad https://en.wikipedia.org/wiki/KiCad :
|
| > _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
| ok_dad wrote:
| I like that part about the bees at the beginning. Also, the CPU
| definitely did blow my mind. Amazing work by the builder!
| felipelalli wrote:
| Now it's time for the next step: build another CPU inside that
| one.
| squarefoot wrote:
| Or better, moving the main Minecraft into the hosted CPU
| emulated into the emulated Minecraft, so that a singularity
| would open and suck the entire Universe into Minecraft.
| ranger47 wrote:
| You remind me of someone... a man I met in a half-remembered
| dream. He was possessed of some radical notions.
| Bolkan wrote:
| https://youtu.be/8LiVGDq01FU
___________________________________________________________________
(page generated 2022-09-19 23:00 UTC)