Probably the single most impressive entry from the #Revision2024 #demoparty : Remnants by Alcatraz

Here's the whole intro executable for your convenience:

68f69f07b013cd10d6bac90391eee2f9bbf601b8cdccf7e7720e41f6c13f7508804702058047082d80ee4c608d28bffcffdf45fcd809df470880fd017503de4405d9edd913df45fef6c1407402dcc2dcc0de4706df45fbd8097404d9cad9e0df47c95629fed918d91a7bf85eb929006029fed902d80bd800d9500cd9187bf1df01d900b10729fed94004d900d9c1d84ffed9c1d84ffedeebdec1d918d95804d9c156d9c2d8c0d900d8c4d9f5d9e1d94702decadee9d910dbf1dbd1ddd929fe7ae15edbf1dac1ddd9d913d907decae2b761ddd9d85f02dfe09e7602e292890d61260245ffd1e8aa83c72881f980010f8521ffc30c00b84c3ed53eca3e09c237ff

video: https://www.youtube.com/watch?v=A9jn6ExjDw8

pouet: https://www.pouet.net/prod.php?which=96536

#demoscene #sizecoding

Remnants by Alcatraz

YouTube

Since this post (https://infosec.exchange/@harrysintonen/112196893735638837 ) about "Remnants" by Alcatraz has gotten some circulation, there might be some people who are somewhat confused about what is going on.

- The video shows execution of a computer program that is total 256 characters long (this comment alone is multiple times longer!). All the visuals on screen are produced by this program in real time.

- #Demoscene is a hacker subculture producing cool stuff just for fun. A more detailed introduction can be found from: https://demoscene-the-art-of-coding.net/the-demoscene/

- #Demoparty is (typically) annual gathering of demosceners. There are multiple different parties, of which "Revision" in Saarbrücken, Germany is considered the "main event" by most. During demoparties there are competitions in various categories (music, graphics, video, realtime executed presentations called demos and smaller demos called "intros", other categories are often included as well). This small program "Remnants" competed in 256-byte intro category (the executable program can be maximum 256 bytes long).

- Even more in-depth explanation can be found from this documentary: "Moleman 2 - Demoscene - The Art of the Algorithms" - https://www.youtube.com/watch?v=iRkZcTg1JWU (enable subtitles!)

Harry Sintonen (@[email protected])

Probably the single most impressive entry from the #Revision2024 #demoparty : Remnants by Alcatraz Here's the whole intro executable for your convenience: 68f69f07b013cd10d6bac90391eee2f9bbf601b8cdccf7e7720e41f6c13f7508804702058047082d80ee4c608d28bffcffdf45fcd809df470880fd017503de4405d9edd913df45fef6c1407402dcc2dcc0de4706df45fbd8097404d9cad9e0df47c95629fed918d91a7bf85eb929006029fed902d80bd800d9500cd9187bf1df01d900b10729fed94004d900d9c1d84ffed9c1d84ffedeebdec1d918d95804d9c156d9c2d8c0d900d8c4d9f5d9e1d94702decadee9d910dbf1dbd1ddd929fe7ae15edbf1dac1ddd9d913d907decae2b761ddd9d85f02dfe09e7602e292890d61260245ffd1e8aa83c72881f980010f8521ffc30c00b84c3ed53eca3e09c237ff video: https://www.youtube.com/watch?v=A9jn6ExjDw8 pouet: https://www.pouet.net/prod.php?which=96536 #demoscene #sizecoding

Infosec Exchange
@harrysintonen Well that is kind of mind blowing...
@harrysintonen Hands down my favorite from the party. Everyone was just repeating "What?" the whole time it was on the screen.
@harrysintonen @firefly how the fuck?? I would love to see an analysis of the binary and how it works at some point, because this is some deep magic.

@endrift The algorithm used to render the 3d scene is "raymarching", which is sort of realtime raytracing. The actual geometry being marched on likely is a fractal of some sort. Finally, a collection of seeds producing nice scenes and camera movement were picked, and these are fed through the system to produce the presentation. The transition effect is a sneaky result of only updating some selection of pixels on each render pass (and thus is "free").

This is my (poor) understanding of the thing without actually looking inside it. It probably is somewhat off, but the broad picture likely is quite close.

Oh yes, I totally forgot, they also managed to fit this all to mere 256 bytes...  

Quite often there will be a writeup of such cool size optimized intros. If it happens it likely will be linked to from the pouet page for the intro: https://www.pouet.net/prod.php?which=96536 #demoscene #sizecoding

Remnants by Alcatraz

256b for MS-Dos, 1st at Revision 2024

pouët.net
@harrysintonen oh yeah I just meant an actual assembly-level analysis of how it works. I'm familiar with raymarching (I implemented a not-very-well-researched version of it when I wrote a Mandelbulb rendered in 2010), I'm just not sure how you could implement that, AND the scene generation, AND the camera pan, AND the scene switching in 256 bytes.
@harrysintonen actually I think I see what you mean about the transition being free: it updates the same subset of the screen via that pixel pattern every update, but it's only noticeable as such when the seed changes, which can be done with a simple branch when a timer overflow. Very clever.

@endrift Right, sorry for codersplaining. 😳

My x86 sizecoding skills are way too feeble to perform any real analysis of it, and it for sure is thick full of some really sneaky code and algos, so I'll wait for some kind of a writeup - hopefully there will be one later.

@harrysintonen the best I've done is implemented the game of life in Python golfed down to the size of a tweet. Can't remember if it was the old size or the new size.
@endrift @harrysintonen this would be excellent for a live stream. I mean disassembling this is easy, then understanding why it works is tricky… I tried explaining how I made Game of Life with „music“ in 256 bytes. That was already complicated to do to an audience. But I think reversing someone else’s code might be super interesting.
@harrysintonen It’s impressive indeed.
Do you know what kind of machine is required to run it at a decent frame rate?
@xtof The competition target machine was specified to be an Intel Core i9 10900K with 32GB of RAM. It is highly likely that it runs quite fine with even slower systems. The readme file mentions it runs fine in a VM, too. *edit* PC competition rules here: https://2024.revision-party.net/competitions/pc/
PC competitions

Revision 2024 PC Competition Rules

@harrysintonen @xtof just tried it off-the-cuff in DOSBox 0.74 and it doesn't resolve the fractal in the raymarching part, I'm out of my depth but I'd guess it uses more modern instruction than DOSBox can interpret?

@mmby Indeed it looks like DOSBox can't run Remnants properly. But fear not, #QEMU has no issues with it. To run the intro on a modern Windows system try:

1. Install qemu from https://www.qemu.org/download/#windows (in my testing I used latest daily build from https://qemu.weilnetz.de/w64/)

2. Download and extract the RAW disk image I prepared: https://sintonen.fi/scene/atz-remnants.img.7z

3. qemu-system-x86_64 -M accel=whpx -drive "format=raw,file=atz-remnants.img"

4. Select 5 from the boot menu. Type: cd demo<return>. Type: remnants.com<return>

NOTE: "-M accel=whpx" requires Hyper-V virtualization to be enabled. Without it the intro does execute, but very very slowly.

While this example is for Windows, I'm quite sure it will run fine with other KVM accelerators as well, such as KVM or Xen on linux. #demoscene

Download QEMU - QEMU

@harrysintonen thanks ❤️
with ›accel=kvm‹ it runs fine on debian on a venerable X220 thinkpad

@mmby

@harrysintonen
Reminds me a bit of !fkkrieger back in the early 2000s.

A single level 3D shoot er with multiple weapons and all the usual stuff in just 48kb...

@harrysintonen Oh cool! What system does it run on? I tried Linux and DOS and Wine and none of them worked.
@harrysintonen Aha, the page says it /should/ be DOS? Wonder what went wrong, then.
@harrysintonen OH it just needed to have a .com extension!
@IceWolf Yeah. All DOS sizecoding entries are .com files. This is because .com has no overhead at all while any other executable file format adds overhead.
@harrysintonen Here I was assuming DOS would interpret it as a COM instead of needing the extension... haha nope!

@harrysintonen Thanks for posting and explaining.

Demos have always been one of my favorite art forms.

The demoscene should be core curriculum.

@harrysintonen Played around with this a little.

If you want to see a longer run of different scenes, you can alter the bytes 80 01 near the end to something like FF FF. That's the operand of the CMP instruction that checks if the last frame has been reached. There's far more to be seen besides what is shown in the default run.

If the demo runs slowly (e.g. no acceleration), you can change the 3F near the beginning into something like 03 or 07. That's part of the TEST instruction that checks whether to jump to the next scene.

The jump to the next scene seems to be a simple const addition to the camera coordinates. On frames 256..511 the formula is slightly different.

@harrysintonen

Reminded me of this one:
https://www.pouet.net/prod.php?which=3397

Which was really, really neat.

But Remnants is next level.

tube by 3SC

256b for MS-Dos, 1st at Syndeecate 2001

pouët.net
@harrysintonen too bad, it does not work with dosemu nor dosbox :(
Harry Sintonen (@[email protected])

Attached: 1 image @[email protected] Indeed it looks like DOSBox can't run Remnants properly. But fear not, #QEMU has no issues with it. To run the intro on a modern Windows system try: 1. Install qemu from https://www.qemu.org/download/#windows (in my testing I used latest daily build from https://qemu.weilnetz.de/w64/) 2. Download and extract the RAW disk image I prepared: https://sintonen.fi/scene/atz-remnants.img.7z 3. qemu-system-x86_64 -M accel=whpx -drive "format=raw,file=atz-remnants.img" 4. Select 5 from the boot menu. Type: cd demo<return>. Type: remnants.com<return> NOTE: "-M accel=whpx" requires Hyper-V virtualization to be enabled. Without it the intro does execute, but very very slowly. While this example is for Windows, I'm quite sure it will run fine with other KVM accelerators as well, such as KVM or Xen on linux. #demoscene

Infosec Exchange
@harrysintonen download 5mo compressed VM to launch a 254bytes demo, it's crazy 😭
@fredix Well yeah, you could optimize it a lot, sure. I just did full FreeDOS install and slapped the intro on top. I think it would work with pretty much just "SYS C:" alone, but I wasn't bored enough to spend more time on it.
@harrysintonen No problem Harry ! thanks a lot, I try your VM the demo works well, thanks a lot ;)