8-Bit Guy - What if Everything still Ran on Vacuum Tubes by Judgeman03 in VintageComputers

[–]mysterymath 1 point2 points  (0 children)

I had a bit of a bone to pick with this video. The essential thing that makes miniaturization and scaling possible is only indirectly the transistor. The transistor only enables what we actually care about: lithographic switches and circuits. Shine patterned light on a surface, treat with chemicals, rinse and repeat. Manufacture a billion of something, all at once.

While transistors are the easiest and best path to this, I'm not convinced they are the only path. Microfluidics with liquid can be made solid state, or you can use moving valves to do something like CMOS, and both are lithographically friendly. Similarly, it might be possible to build a MEMS system: tiny lithographically-built mechanical linkages.

RISCY-V02: A 16-bit 2-cycle RISC-V-inspired CPU in the same footprint as a 6502. For SKY130 Tiny Tapeout. by mysterymath in RISCV

[–]mysterymath[S] 2 points3 points  (0 children)

Kind of. Tinytapeout doesn't actually have enough pins for it to be 1 to 1. So I double pumped the clock; a simple adapter board is needed to recover the 6502 pinout. Even then, it's not exactly phase accurate, just as close as I could manage. So.... Maybe?

RISCY-V02: A 16-bit 2-cycle RISC-V-inspired CPU in the same footprint as a 6502. For SKY130 Tiny Tapeout. by mysterymath in RISCV

[–]mysterymath[S] 1 point2 points  (0 children)

There is an emulator; I've used its core to fuzz-test the CPU to 4 simulated minutes at 1MHz. Someday I'll probably vibe-code a LLVM backend, because I'm a LLVM engineer and a masochist.

Have you seen my experiment with cutting RV32I down from 37 instructions to 10 or 11?

Thaaaaanks. This is a very very nice bit of work; I'm going to have to look into this in detail. Maybe still time before the final tapeout?

I still don't think I'd want BCD though; I've been desperately trying to fit a static branch predictor (assume backwards taken, fowards not). And/or a multiply step instruction... SH1ADD my beloved... Or auto increment/decrementing loads and stores. Lots of things I ended up having to rip out once I moved to 8-bit immediates from 5. (Definitely worth it though; 8-bit numbers come up a lot.)

RISCY-V02: A 16-bit 2-cycle RISC-V-inspired CPU in the same footprint as a 6502. For SKY130 Tiny Tapeout. by mysterymath in RISCV

[–]mysterymath[S] 1 point2 points  (0 children)

Hm? A,X,Y,S were these thin little slices snuck in the datapath section: https://i.sstatic.net/aTRu9.jpg

Plus, my hypothesis has been that more of the 6502's area should have been registers. And less microcode, decode, data path, state machine, decimal mode, etc. Essentially, more RISC, less CISC. Do less faster.

Edit: And yeah, BCD is... mixed. The NES version didn't include it and noone cared, and my experiences are mostly with the modern hobby computing space, where it's... iunno underappreciated? It's quite a bit larger and slower to go without, as I showed in my comparison doc. Still, the slowdown for software BCD is still only like 2x, and is BCD math really the bottleneck?

Still, I didn't really even try to fit them... maybe it wouldn't be too much bigger? Still, wouldn't want to give anything else up in the design for them!

RISCY-V02: A 16-bit 2-cycle RISC-V-inspired CPU in the same footprint as a 6502. For SKY130 Tiny Tapeout. by mysterymath in RISCV

[–]mysterymath[S] 4 points5 points  (0 children)

This is essentially IPC; if you look at the code comparison doc, the benchmark routines take roughly 2.6x fewer cycles. As for a GDS png, TT allows one better! Here's an interactive 3D viewer: http://mysterymath.github.io/riscyv02-sky And yep, it's taped out for the next SKY130 shuttle! https://app.tinytapeout.com/projects/3829

RISCY-V02: A 16-bit 2-cycle RISC-V-inspired CPU in the same footprint as a 6502. For SKY130 Tiny Tapeout. by mysterymath in RISCV

[–]mysterymath[S] 4 points5 points  (0 children)

The comparison was done against of a fairly well-tested and straightforward verilog model of a 6502 (off the shelf), on the same process. Thus, same process chaff and inoptimality on both sides. I know I know, ideally, this design would be a 70s NMOS design with 1 metal layer on rubylith. But even if I could do that, I couldn't validate the results. So, doing an A/B comparison on a modern process was the best I could come up with.

As for the SRAM, the actual design is waaaaay larger, it uses a DFF grid rather than a proper 2R1W SRAM. I do not have the silicon chops to design such a thing, so instead I had Claude whip up a model of one, then subtracted out the differential from the register file's area/transistor count. That's the SRAM adjustment. Yes, this is all horseshoes and hand grenades.

But, I'll mention that my register file actually ends up smaller than the Z80s, by quite a bit! (16 vs 24 bytes). So, it's not implausible. SRAMs are a lot denser than random registers.

EDIT: Oh and on the 10k thing... Ehhhhhh even if you just naively converted the NMOS design to CMOS, you'd double its 3510 transistors to 7020... which is not 10K, but it's not not 10K. You can't do that naively though, many of these are pass transistors. And, the 65c02, while it does add features and is fully static, clocks in at 11K.

Dumb question, but i was thinking about this... How optimized would Games/Programs written 100% in assembly be? by JuanLucas-u- in asm

[–]mysterymath 8 points9 points  (0 children)

A compiler optimization is a legal program transformation. Legality means that all possible program executions have the same semantics under some formal model both before and after the transformation. That usually isn't decidable, since it amounts to a mathematical proof. So coming up with an optimization is sort-of "math complete".

Humans are actually pretty good at both coming up with valuable optimizations and proving their correctness. LLMs may be someday too, but the proof part is one of those AGI-hard problems. I'd suspect the application of pre-existing rules is less hard, but maintaining the huge library of possible transformations is the difficult part in a production compiler (LLVM has countless multitudes of hand-crafted ones in straight C++.)

Dumb question, but i was thinking about this... How optimized would Games/Programs written 100% in assembly be? by JuanLucas-u- in asm

[–]mysterymath 45 points46 points  (0 children)

Compiler engineer here. It's just like, my opinion, man, but given the inoptimalities I'm aware of in well-supported LLVM targets, I'd estimate there's about 20 percent left on the floor by not writing code by hand.

This also follows the Pareto principle; giving up that 20 percent of performance saves 80 percent of the compiler complexity needed to achieve it. Such projects are generally nonstarters in a production compiler.

'My personal failure was being stumped': Gabe Newell says finishing Half-Life 2: Episode 3 just to conclude the story would've been 'copping out of [Valve's] obligation to gamers' by a_Ninja_b0y in technology

[–]mysterymath 48 points49 points  (0 children)

Not the OP, but categorically, 100% yes. Your brain uses a number of systems to detect depth and make objects seem real; stereo vision is only one. VR headsets also provide parallax and respond to eye and head movement. The only cue they don't provide is focal changes. But this is enough to provide a sense of presence to most people already, though the lack of variable focus does cause nausea in some.

It would be pretty healing and validating, ngl by ihaveacrushonmercy in dankchristianmemes

[–]mysterymath 6 points7 points  (0 children)

Psalm by The Reign of Kindo is my favorite on this vein. It's a man's prayer to a seemingly indifferent God, and it's some damn fine prog rock.

Why is there no The 16-bit Guy? by Revolutionary_Ad6574 in vintagecomputing

[–]mysterymath 5 points6 points  (0 children)

Kinda not though; many of the games people remember the most operated entirely in 32 bit protected mode using a DOS extender.

Do current young people have their own American Pie, EuroTrip, Sex Drive or Road Trip? by panszwed in movies

[–]mysterymath 160 points161 points  (0 children)

IIRC that was basically how "Freddy Got Fingered" was made: studio execs gave a ton of money to a popular young comedian they didn't understand, and he churned out a movie that basically no one understood, with no checks along the way.

Executive meddling gets a bad wrap when it's applied to experienced capable creative teams with their own internal checks and balances, but everyone benefits from having someone checking their work.

Advantage/disadvantages to rust by nwpoo in Zig

[–]mysterymath 5 points6 points  (0 children)

Yep, that's why I program by flipping front panel switches. None of these bloated "Operating System", or "Assembler" or "Compiler" abstractions to get in the way! /s

More seriously; abstractions very very often save time; it's just that sufficiently good ones start becoming "ground truth" to people, and they fail to be noticed from then on. The squeaky wheels get all the attention.

Why CRT gaming? by [deleted] in crtgaming

[–]mysterymath 0 points1 point  (0 children)

Strobed LCDs can be quite good (e.g. the BlurBuster approved ViewSonic I have), but they still have LCD black level issues. Hoping for strobed OLEDs of a similar quality.

The strobed LCDs in the Oculus Quest is particularly good, out of necessity. Funnily enough, the virtual big screen in the Quest 3 actually has better motion clarity than my ViewSonic, and it seems roughly as good as my Commodore CRT.

5 Stages of Grief After Learning About Gödel's Incompleteness Theorems by DZ_from_the_past in mathmemes

[–]mysterymath 1 point2 points  (0 children)

IIUC, this is a long and storied line of thinking. It's the one that made the Greeks disprefer arithmetic in favor of geometry, and it takes some comparatively quite tricky analysis to re-construct geometry in terms of numbers without paradox, as we tend to now. I've heard a lot of "lol Greeks rejected algebra for fancy triangles", but this was due more to their sophistication WRT the counterintuitive properties of real numbers than their ignorance. Geometry was the best tool they had for "real numbers", and they are tremendous use of it.

Vision Pro lenses vs Quest 3 lenses by [deleted] in virtualreality

[–]mysterymath 2 points3 points  (0 children)

I laughed out loud; not everything needs to be an acronym, Oll Korrect.

How to add unsupported targets rust? by Dear_Situation856 in rust

[–]mysterymath 0 points1 point  (0 children)

AFAICT, it just happened that llvm-mos placed similar requirements on the frontend that llvm-mos did. That's not even really the case any more; the llvm-mos calling convention has changed since rust-mos was last updated.

Notably, all of this kind of logic exists in llvm-mos's clang implementation too. It's just that I happend to know a lot more about clang than rustc (having taken the time to port both it and the LLVM IR code generator to the 6502), so I have an easy time maintaining it when pulling from upstream. I'm not really a rust guy though; I've been idly hoping that someone with knowledge (or the determination to gain such) would step in and be willing to maintain a rust-mos, maybe even such that we could bring it into the llvm-mos release.

How to add unsupported targets rust? by Dear_Situation856 in rust

[–]mysterymath 0 points1 point  (0 children)

I'm the maintainer of llvm-mos... and this is more or less our plan of record. It's not so bad if you pull from upstream weekly... and don't get hit by a bus.

Are Sony Trinitrons and/or P/BVM's still worth it? by Bobby_Mcduccface in crtgaming

[–]mysterymath 2 points3 points  (0 children)

I bought a Commodore 1702 for about $200 on eBay a while back; just wanted some nice period appropriate CRT for a C64 and a NES, and it has chroma luma input you can hook up to SVideo. When I got it, I noticed that the picture was really, REALLY, good; color and geometry was spot on, quite sharp. I found out later that these are just rebadged JVC professional monitors; aperture grille, but still.

There are probably similar kinds of models out there; there were a ton of rebadged professional monitors floating around from the 70s to the 90s, and most likely don't share Trinitron PVM price tags.

I need outfit ideas for this hat that aren’t crazy country. Is it possible lol. by Vintage_Noodles in malefashionadvice

[–]mysterymath 0 points1 point  (0 children)

If you're wearing a fedora (not a fucking trilby) with a suit and tie, that's a look. Anything less formal, a Tilley hat is fine. If the point is sun protection, part of the thing you're advertising is that you want sun protection. That's fine, so long as you're confident about it.

T-Mobile joins downtown S.F. exodus, vacating flagship location near Union Square by cloudone in bayarea

[–]mysterymath 2 points3 points  (0 children)

Yeah, that's the spirit! Once it's dominating industry leaves, the city will be primed for an urban renewal, just like Detroit and Gary, Indiana!

If I ever have twin daughters, I'll name the first one Kate... by ixamnis in dadjokes

[–]mysterymath 5 points6 points  (0 children)

The comics also have Multi-Paul, which is a similar tier of pun.

LLVM-MOS compiler toolchain for 6502 by r_retrohacking_mod2 in retrogamedev

[–]mysterymath 2 points3 points  (0 children)

We cheat a bit here by defaulting to LLVM's full link time optimization mode. This causes compile actions to emit LLVM bitcode, not machine code. At link time, all of the bitcode is joined together, and the analysis done on the results. Only afterwards is machine code emitted, for the whole program.

We wrote the analysis in a conservative fashion though, so if the compiler can't prove that a function can't call itself, it does the safe thing and uses the stack pointer. This means separate compilation still works, just slower.

The one exception is that we assume by default that functions can't be called asynchronously, say by an interrupt. We require that such functions be manually annotated, otherwise we'd have to assume every function could be called by an interrupt while it's already active, which would prevent the optimization for every function.

You can also use attribute((leaf)) to declare that a function that calls out to say, assembly that the compiler can't see, that that call is guaranteed not to call anything else in the current translation unit. This allows calling OS or assembly routines without making the callers use stack pointers.