@dneto@mastodon.gamedev.place avatar

dneto

@dneto@mastodon.gamedev.place

Vulkan, WebGPU shader stuff at Google.
WGSL editor.
Former SPIR WG chair @ Khronos; still doing SPIR-V.
GitHub @dneto0 Twitter @dneto1969

Searchable

This profile is from a federated server and may be incomplete. Browse more on the original instance.

dneto, to random
@dneto@mastodon.gamedev.place avatar

I'm disappointed in you NYT

litherum, to random
@litherum@masto.ai avatar

WebGPU mesh shading when

dneto,
@dneto@mastodon.gamedev.place avatar

@litherum

Hehe.
No joke we are still filling out the conformance test suite. And still finding bugs with it.

litherum, to random
@litherum@masto.ai avatar

I wonder why so many production compilers are written in C++, a language particularly ill-suited to writing compilers in

dneto,
@dneto@mastodon.gamedev.place avatar

@litherum
Oh this is an interesting question.

First, what is a "production" compiler: that implies maturity and that it underlies serious other business/concerns. Like >10K users over 5+ years, or supports > 100M$ over 5+ years.

From that standpoint Erlang would qualify but is (mostly) written in Erlang.

Aside from that, "most" production compilers are > 10 years old, ruling out Rust and Swift.

1/x

dneto,
@dneto@mastodon.gamedev.place avatar

@litherum

Wirth's Oberon I'm sure was beautiful but I wouldn't call it "production" (forgive my ignorance if I'm wrong). (Reading a little it seems it suffered fragmentation).

Now think back to 2014: what other languages would you use for a compiler project that would outlast you by 10 years: Java? (no thanks, too slow IMHO)
C? Well GCC was C for a long time, and it took a big fight to change it to C++. But I guess you'd think C would be even worse.

2/x

dneto,
@dneto@mastodon.gamedev.place avatar

@litherum

I think the rest is sociological/ecological. C++ is "good enough" in a lot of dimensions: 1. existed, 2. programs run fast (and programmers want fast compilers) 3. Significant programmer mindshare so the project personnel can change over time without too much fuss. 3. Software licenses disclaim liability, so it doesn't have to be reliable.

I think the fundamentals of "Worse is better" kick in and are hard to overcome.
https://en.wikipedia.org/wiki/Worse_is_better

3/x

dneto,
@dneto@mastodon.gamedev.place avatar

@litherum

One more thing: I think a lot of people think "production compiler" means "generates machine code", and for that we usually think of self-hosting environments where the source and target languages interface with the OS. So has been a strong bias to matching the ABI of the OS you're on. (MacOS was originally written in Pascal which feels absurd these days). Nowadays we're more used to cross-compilation being built in and easy. Not so 20 years ago.

4/x

dneto,
@dneto@mastodon.gamedev.place avatar

@litherum

But I think going forward we have a good chance at a different future.

  1. Rust. Especially if liability becomes a real issue. (Interesting the White House is nudging the industry to use memory safe languages... Ada didn't quite work out...).
    Vibrant and committed community building important software.

  2. Swift, Go. I really don't have enough info about Swift's sociology, and Go seems branded as a "server" language when it really isn't just that.

5/x

dneto,
@dneto@mastodon.gamedev.place avatar

@litherum

Not Java: had its chance already for 29 years and is materially less good than the choices above.

6/x

dneto,
@dneto@mastodon.gamedev.place avatar

@litherum

Heh. And what is "good for compilers"? I'd posit that beyond basic functionality, the main challenges in compiler implementation are not language primitives.

From my experience the main challenge is: design the thing so you can test it, then test it up the wazoo. (Also, make it fast enough.)

7/7

dneto,
@dneto@mastodon.gamedev.place avatar

@litherum @dj2

Yes, generally it's in C++ for the reasons given.
+1 to what Dan said, even the "Rust if we started today" part.

We have a bit of a momentum issue in favour of C++; switching to Rust we'd need to accomodate rampup time for folks to gain proficiency.

Also: Tint doesn't directly use the WGSL grammar or the SPIR-V JSON grammar (!).
It does have its own DSL for the builtins table, that drives a lot of validation and diagnostics logic.

dneto,
@dneto@mastodon.gamedev.place avatar

Also, Tint being in C++ makes it easier for other C++ projects to embed Tint. That's worth consideration too. The graphics industry still has a lot of C++ users.

dneto,
@dneto@mastodon.gamedev.place avatar

It's network effects all the way down, basically.

(Tapping the sign: computing is a social enterprise!)

zeux, to random
@zeux@mastodon.gamedev.place avatar

New blog post! Here we'll cover the speed of light for LLM inference for transformer models and why it's a useful metric. https://zeux.io/2024/03/15/llm-inference-sol/

Boosts appreciated :)

dneto,
@dneto@mastodon.gamedev.place avatar

@zeux
This is excellent!

gfxstrand, to random
@gfxstrand@mastodon.gamedev.place avatar

So... It turns out control-flow re-convergence is hard...

dneto,
@dneto@mastodon.gamedev.place avatar

@gfxstrand
I'm rooting for you!

(Some people think it's just an easy bugfix.
Some people think it comes automatically.)

dneto,
@dneto@mastodon.gamedev.place avatar

@gfxstrand
That's cooperative groups, sure.
I guess I don't know how that manifests at ISA/register level. A mask token that is saved before divergence and then carried with each thread? So the zeroes in....? Or is that naive.
Anyway, no obligation to serve my curiosity.

litherum, to random
@litherum@masto.ai avatar

In today's episode of "things I dislike about the Vulkan API"...

When you build an acceleration structure, you have to allocate a destination buffer for the AS to live in. You know how much size to allocate by vkGetAccelerationStructureBuildSizesKHR(), to which you pass a description of the AS you want to build. Sure, fine.

Then, when you want to actually build the AS, you pass the same description object to the build function. Elegant, right?

Turns out, no, it's not ....

(1/4)

dneto,
@dneto@mastodon.gamedev.place avatar

@litherum

Seems almost like the pattern of query APIs that serve to both give you the number of results or the results themselves. You have to call them.twice: first to get the count (but with null array ptr) then you allocate space for the answer then you call a.second time to populate the array.

Example
https://registry.khronos.org/OpenCL/sdk/1.0/docs/man/xhtml/clGetPlatformIDs.html

Except in this case it's two different API entry points.

TomF, to random
@TomF@mastodon.gamedev.place avatar

Reading Biden's transcript I can see myself very easily. I constantly misremember what year something happened in my life, or how long I was at a job. I mean, I have a terrible memory in general, but I can be spectacularly wrong about what year something happened.

I know this isn't "average", but it is "normal", i.e. well within the bell curve of humanity. And you know how to solve the problem? You write stuff down. It's not exactly a debilitating weakness. You just write stuff down.

dneto,
@dneto@mastodon.gamedev.place avatar

@TomF

At my 20th wedding anniversary dinner we tried to name a significant thing in our lives from each year of our marriage. I had a hard time and missed a few. Made me sad to feel life slipped away so easily.

OTOH, upon hearing a song fragment I can often pin it to its year. Drives my kids bananas, but makes me feel good.

dneto, to random
@dneto@mastodon.gamedev.place avatar

Holy cow.

Back in the 80s I bought an album of instrumental music: the Wyndham Hill Sampler album for 1988. (That was a thing record companies did, to generate interest for music that would otherwise not get attention, definitely no mainstream airplay.)
The album had some great stuff on it, and I've missed it.
I could never find it on streaming services...until today. Yowza this brings back memories.
"Climbing into geometry" (!) for example.

https://music.youtube.com/playlist?list=PL7CECD5718BD137B2&si=M_a9vDB_igateOhn

dneto,
@dneto@mastodon.gamedev.place avatar

Listening to it now, I remember a lot of it, like detailed melody lines. I must have played it a lot while doing uni homework. I'm feeling a lot of math...

dneto, to random
@dneto@mastodon.gamedev.place avatar

Pet peeve: the word "headcount"

I find it reductive and demeaning.

Prefer "staff", "staff level", or "staffing".
Treat people like full human beings.

dneto,
@dneto@mastodon.gamedev.place avatar

@litherum

I'm not so bothered by "all hands" for some reason maybe because it taps into the older (naval?) tradition of "all hands on deck"?
Maybe I'm just inconsistent

julienbarnoin, to GraphicsProgramming
@julienbarnoin@mastodon.gamedev.place avatar

I'm curious to hear if anyone has successful strategies for debugging shader compile time issues (specifically in in my case but still interested in hearing about others).

I've got this shader that takes over a minute to compile. There's various things I could do to prevent loop unrolling etc. but I still have to use trial and error to find the right place.
Do you have any better strategy than changing random places and seeing what makes a difference?

dneto,
@dneto@mastodon.gamedev.place avatar

@NOTimothyLottes @beanz @crzwdjk @julienbarnoin @aras @solidangle

COMMON blocks.
You've just reinvented Fortran COMMON blocks with (1.) and (2.)

dneto,
@dneto@mastodon.gamedev.place avatar

@NOTimothyLottes @beanz @crzwdjk @julienbarnoin @aras @solidangle

Tongue in cheek, but you're giving me flashbacks to the explicit predication using "indicators" (a.k.a. flags) in the Calculation lines in RPG II. You could have up to three predicates apply to guard a line of code or output.

dneto,
@dneto@mastodon.gamedev.place avatar

@NOTimothyLottes @julienbarnoin @aras @solidangle @beanz

We've seen bad big-Oh algorithms in FXC and driver compilers.

spirv-opt algorithms were originally written for simplicity, but not obviously wasteful algorithms. If you see a quadratic or worse blowup, do file a bug.

The very first thing spirv-opt (or size or speed; almost the same recipes) is to inline everything; passing large structs around might be bad in any case.

dneto,
@dneto@mastodon.gamedev.place avatar

@beanz @crzwdjk @julienbarnoin @aras @solidangle @NOTimothyLottes

WGSL can pass pointers as params. But it also adds no-aliasing rules so that:

  • it's safe to map to inout in backend languages HLSL or GLSL, and
  • it's correctly maps to pointer args in MSL and SPIR-V.

The legalese is here: https://www.w3.org/TR/WGSL/#aliasing
But that doesn't explain the implementation strategy.

And Chrome 123 made pointer params a lot more flexible. See
https://developer.chrome.com/blog/new-in-webgpu-123?hl=en#unrestricted_pointer_parameters_in_wgsl

dneto,
@dneto@mastodon.gamedev.place avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • rosin
  • InstantRegret
  • mdbf
  • GTA5RPClips
  • cisconetworking
  • DreamBathrooms
  • ethstaker
  • magazineikmin
  • thenastyranch
  • ngwrru68w68
  • Youngstown
  • slotface
  • kavyap
  • JUstTest
  • Durango
  • khanakhh
  • normalnudes
  • modclub
  • cubers
  • tacticalgear
  • osvaldo12
  • everett
  • Leos
  • anitta
  • provamag3
  • tester
  • lostlight
  • All magazines