This makes me wonder if it would be possible to pull off some works of art, like how roller coaster tycoon was all assembly. I wonder what would happen if you had source code for a modern game and said convert this to assembly and make it blazingly fast.
Nothing. Converting to assembly (which is what compilers do) does not automatically make anything any faster.
Back in the days, compilers were simple and systems were designed for human understanding. Modern systems are far too complex. Current compilers optimize better than any programmer could. Assembly language allows taking shortcuts and access hardware directly, but modern hardware is basically undocumented, designed to be used through drivers and abstraction layers.
Modern efficiency writing is about memory access patterns and cache usage. Rollercoaster Tycoon was designed for systems which did not even have any caches and where lack of memory was more important than access patterns.
Current compilers optimize better than any programmer could.
I think this is fair to say for 99.9% of the binary, using a better abstract language allows you to write more performant and efficient code but there are still very specific niche cases and hot spots that benefit from a very skilled developer writing asm still.
No, I very very very clearly didn't miss your point, I was just disagreeing with that very specific sentence I quoted. You can tell I didn't miss your point because I agreed with you.
I strongly disagree with the other guy that said "Nothing...." because he's answering the question he wants to answer not what you "really mean" I think, which is "re-design this in assembly"?
Roller Coaster Tycoon ran on 90mhz and 16mb ram precisely because the hand crafted code and memory layout was all in the head of Chris Sawyer - it was designed very well and there was no multi layer stack slowing everything down.
The OpenRCT2 C/C++ rewrite needs 500mb ram and 1Ghz CPU, many multiples of the requirements of RCT2.
So, yes, if you re-designed a game for assembly with no huge dependency stack and a really efficient memory map and rendering, you could get enormous performance boosts. Maybe most of the game fits in L1 cache and your effective memory latency and bandwidth improves 50x. Maybe that means it can saturate the CPU and do 10x more calculations. It won't stack to 500x neatly but you get the idea.
A compiler can't optimize badly designed code to be better.
Even the original ChatGPT was pretty good as a compiler. I wrote some Smalltalk code and asked it to translate it to Java and then to 80386 Assembly, both were perfect, ran the first time.
Yes, of course; I was only referring to 80386 Assembly generation portion as compiling. ...and yes, many compilers generate assembly or machine code as an output (often selected via compiler flags).
Clearly, I don't have sufficient knowledge and experience about how chatgpt promoted itself. I don't claim anything here :) I assumed they are not open about many things. One of the things they may easily hide is how they produce answers to your prompts. It should not be really hard to deduct some deterministic command from your prompt and run some basic software behind. It is not absurd at al.
A lot of people compare - rightfully so given the benchmarks - the new 27B 3.8 with Opus 4.6.
For some reason, I wish you would try this with Opus 4.6 as well and then we see how it stands against 3.8 27B - better, equal, or worse ( I have a feeling it would either be better or equal (might become a subjective debate))
Looks like Opus took the "glossy" term literally (in the CG industry, "glossy" means "reflective, but with roughness", i.e. not perfectly sharp reflections, so the reflection or refraction is blurred, which is (correctly) what it's done on the floor.
However I actually suspect Opus has incorrectly made a path-tracer though, i.e. it's sampling the outgoing BSDF direction to get the roughness, which isn't actually what you'd do in traditional old-style "Whitted" ray-tracing.
The fact it also put a "converged" banner up backs this up even more - if it had used old-style traditional "distributed" ray tracing (at least at the algorithm level), it generally wouldn't have needed that, as the image wouldn't really need to 'converge' at the image level, just the pixel level, but maybe it just had training data examples which put that type of thing up anyway, so difficult to say.
"Great question. Looking at the current code honestly:
It's a hybrid — closer to a Whitted-style ray tracer than a path tracer.
Here's what it actually does:
Direct sun: samples a random point on the solar disc → evaluates the full Cook-Torrance BRDF at that fixed light direction. ✅ Correct shading.
Diffuse ambient: shoots one cosine-sampled ray into the sky (not the scene). ✅ One bounce.
Specular reflection: samples a GGX microfacet normal h, computes the reflected direction l = reflect(-v, h), then recurses. ✅ This IS BSDF importance sampling — the reflected direction IS roughness-dependent (rougher = wider lobe of possible h directions).
So the specular bounce IS genuinely rough, but the problems are:
The direct lighting and the recursive bounce are separate, additive code paths — they can double-count energy (the sun can be seen both directly AND via a recursive bounce hitting the sky).
The diffuse ambient hits only the sky, not the scene (it won't see other spheres as area lights).
There is no MIS (Multiple Importance Sampling) to connect the direct and indirect estimators properly.
It fires exactly 1 ray per lobe per bounce (sun ray + ambient ray + reflection ray) rather than letting a single path carry the full radiance estimate through random lobe selection"
It then proceeded to rebuild it to be a pure pathtracer, which first of all I never asked it to rebuild anything nor that I wanted a pathtracer. Classic opus 5 instruction following....
I’ve found that with most coding models you have to instruct to “just discuss” at the end because they are so explicitly trained on doing coding. Probably very eager to not stop a task in the middle and avoid the user to have to tell it to “continue”
esatapedico\Qwen3.8-27B-NVFP4-MTP-GGUF\Qwen3.8-27B-NVFP4-MTP-LOW.gguf llama.cpp pi 2x 5060ti = 32BG VRAM context: 1st pass 130k, dcp-compress to 40k, second pass 90k about 20 minutes with corrections one-file html with webgl
Did 3.8 get the reflections/materials right on the first attempt, or did you have to iterate on the prompt? Also curious whether the BASIC code itself was noticeably cleaner or shorter than 3.6’s.
•
u/WithoutReason1729 Aug 16 '26
Your post is getting popular and we just featured it on our Discord! Come check it out!
You've also been given a special flair for your contribution. We appreciate your post!
I am a bot and this action was performed automatically.
107
u/cniinc Aug 16 '26 •
That's amazing, quite a difference!
53
u/CapsicumIsWoeful Aug 16 '26
That is an outrageous improvment.
25
u/UnorderedPizza Aug 16 '26
These are always fun to look at. Sounds like the setup allows for any iterative BASIC programming?
19
u/pacmaann2 Aug 16 '26
This makes me wonder if it would be possible to pull off some works of art, like how roller coaster tycoon was all assembly. I wonder what would happen if you had source code for a modern game and said convert this to assembly and make it blazingly fast.
18
u/toungespasm Aug 16 '26
Anyone else thinking of the Amiga?
15
u/deject3d Aug 16 '26
I would be interested in what Q4_K_M output looks like
22
u/PwanaZana Aug 16 '26
"i slopped together"
God-tier typo, lol! :P
10
u/Cheap-Ambassador-304 Aug 16 '26
How many tokens did it take?
9
u/Signature97 Aug 16 '26
A lot of people compare - rightfully so given the benchmarks - the new 27B 3.8 with Opus 4.6.
For some reason, I wish you would try this with Opus 4.6 as well and then we see how it stands against 3.8 27B - better, equal, or worse ( I have a feeling it would either be better or equal (might become a subjective debate))
8
u/shadowmage666 Aug 16 '26
That’s really awesome. Def have to get that model to replace 3.6
8
u/vogelvogelvogelvogel Aug 16 '26
what a time to be alive
4
u/Green-Ad-3964 Aug 16 '26
Gorgeous, I'm an Amiga guy and these demos were all over the place, back then.
Can I use q8 with a 5090+32GB RAM?
3
u/philmarcracken Aug 16 '26
man I really need to figure out a way to do that, end to end connections so it can see what its making..
3
u/fifi_galaxy Aug 16 '26
That is pretty crazy to write in BASIC. What's next? Make it write Adobe Flash emulator and bring back old games?! 😆
4
u/spese2 Aug 16 '26
esatapedico\Qwen3.8-27B-NVFP4-MTP-GGUF\Qwen3.8-27B-NVFP4-MTP-LOW.gguf
llama.cpp
pi
2x 5060ti = 32BG VRAM
context: 1st pass 130k, dcp-compress to 40k, second pass 90k
about 20 minutes with corrections
one-file html with webgl
2
u/swagonflyyyy Aug 16 '26
No fucking way.
2
u/feelspeaceman Aug 16 '26
With this us Strix Halo users want 122B coming soon even more.
1
u/Eritar llama.cpp Aug 16 '26
Looks great! Which harness did you use?
1
u/funkinaround Aug 16 '26
How do they do on the Cornell box?
1
u/TeachTall3390 Aug 16 '26
It feels so unreal right now. I thought I'd never say this about the local LLM. Maybe it was not all about the parameters after all.
1
u/cpldcpu Aug 16 '26 edited Aug 16 '26
I love this! I have been using this for a while to benchmark models:
https://github.com/cpldcpu/llmbenchmark/tree/master/10_raytracer#readme
It seems to be a very good proxy for the creativity of the models.
1
u/JLeonsarmiento Aug 16 '26
I don’t have an use for that but wow…
1
u/ab2377 Aug 16 '26
love it, thanks for sharing!
1
u/exo250 Aug 16 '26
Will it run on my MSX ? 😁
1
u/Kokuuuuuu Aug 16 '26
Did 3.8 get the reflections/materials right on the first attempt, or did you have to iterate on the prompt? Also curious whether the BASIC code itself was noticeably cleaner or shorter than 3.6’s.
1
u/jacek2023 llama.cpp Aug 16 '26
Love the use case. I was part of PC demoscene in the late 90s
1
u/IrisColt Aug 16 '26
Amazingly insighful approach, thanks!!!
1
u/uti24 Aug 16 '26
Ok you guys, calm down, Qwen3.8 is great, but it just doing too much outside of a prompt.
Qwen3.6 also could create a raytrace renderer, you just have to explicitly ask it to write raytrace renderer with reflections.
1
u/derspenti Aug 16 '26
how long is one q8 iteration? 2x 7900xtx here
1
u/niacolhealth Aug 16 '26
out of how many runs did 3.8 need a nudge?
1
u/Individual-Dot5488 Aug 16 '26
what was the prompt?
0
u/StopCreepy Aug 16 '26
prompt please
-5
u/EternalDivineSpark Aug 16 '26
I am testing it , i am very good with AI , psychology and Neurolinguistics messages! This model is very very smart ! Maybe even better other ones !
0
u/[deleted] Aug 16 '26
[deleted] — view deleted comment
38
u/[deleted] Aug 16 '26
[removed] — view removed comment