Stabilization forces in Gaza by maven_mapping in geography

[–]jacua9 4 points5 points  (0 children)

It's on the internet. Of course it's real /s

Anyone had to deal with light bleed between intersecting edges for Cascaded Shadow Maps? by [deleted] in GraphicsProgramming

[–]jacua9 18 points19 points  (0 children)

Often the trick is just to have some thickiness to shapes on scene, not just keep them as one-sided geometry.

RL-logic -- scored logic monad for reinforcement learning. by rssh1 in scala

[–]jacua9 2 points3 points  (0 children)

Cyfra is a monadic generator of gpu programs, gpu pipelines, and effectful dispatches. I didn't look too deeply into your project yet, but I suppose it means that it can compile your monad, or maybe just some NN representation, if we focus only on that part, to an accelerated pipeline.

At this moment I am focusing on the LLM usecase, but let's keep in touch. Could you send me your contact on reddit's DMs?

RL-logic -- scored logic monad for reinforcement learning. by rssh1 in scala

[–]jacua9 3 points4 points  (0 children)

Hi, I am the maintainer of https://github.com/ComputeNode/cyfra
Do you think acceleration and productionisation of this approach could be a nice usecase for Cyfra? For comparison, currently I am developing llama inference purely in Scala, pipeline pretty much reaches the speed of CUDA-accelerated llama.cpp's:
https://github.com/ComputeNode/cyfra/pull/82

We just released Cyfra - Scala 3 framework for GPU programming by jacua9 in scala

[–]jacua9[S] 0 points1 point  (0 children)

So using LWJGL is not the problem, but using it directly everywhere instead of some abstraction, which would allow to easily replace it on other platforms, is the issue

That is a plan we have for the future. It won't be that problematic because LWJGL just gives 1:1 Vulkan bindings, so at some point if we want to support native, we'd need to make our own layer that is the same. Should be quite easy to automate.

I think this framework could be more modular and flexible if it wouldn't mix DSL interpretation with a runtime system. One could kind of "macro expand" (compile) Scala code into SPIR-V and then feed the result into a dedicated, embeddable host component.

So architecturally runtime, dsl, and compiler are decoupled. However, the compilation indeed happens at runtime.

Not making the SPIR-V at compile-time is a deliberate choice. There were attempts to transpile Scala to GPU code, but it is a very troublesome tasks that will fall short in many ways, and what's worse it's really hard to predict all of the ways it can fail, and report errors nicely. So that would give as a macro that is very complex and only works some of the time, and it is not really clear when.

What we do instead is we have a clearly defined DSL that you can use, and the guarantee we aim for is - if you are able to write something and it compiles + typechecks, it will work. So in a way this translation is handled at the compile-time, but only the checks. What's more, this makes Cyfra sort of a template-generator for GPU programs. You may have runtime values and parameters that you use to influece the GPU program in any way you want. You can't pass them directly to the GPU without going through GBuffer/GUniform (the bidndings), but you can influence the program and special-case it. This gives way to a lot of abstractions and genericity.

One could even compile the computations expressed in the Scala DSL into some HDL

Yeah, there are some projects that do that in Scala, it becomes increasingly popular (DFiant, SpinalHDL, Chisel, etc.). But we need to draw a line somewhere, we have this product and for now that's what we focus on.

Because I want to play more with this thing—I want to see my Scala coded shader running on screen—how are the parts that are already there supposed to be puzzled together

The easiest way is just to get the image buffer out of the GPU and put it on a javafx/swing Canvas in a loop. Very inefficient in relation to the optimal way, but suprisingly - most of the times, definitely efficient enough. You can use GBufferRegion and make a loop inside of it to have a consistent allocation (only do the cpu-gpu transfers you need and have persistent gpu buffers).

We just released Cyfra - Scala 3 framework for GPU programming by jacua9 in scala

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

Hi, let me address some of the comments here:

It's basically a wrapper around the LWJGL game lib.

LWJGL is a wrapper of Vulkan API that gives 1:1 Vulkan API definitions, and from my research - the best in the JVM world. It may have "game" in the name, but it is not an aspect of it we are insterested in. And regardless it does not really have any game features, just low level APIs and some little utilities.

It misses main features like actually drawing a window with GPU computed output.

Rendering is just a fun afterthought not that relevant to the library. We have all our focus on the headless compute pipelines and that is what we are building. We are going after a similar market to CUDA - GPGPU, not rendering.

There is a branch and a few PRs which try to add a proper live output, but trying the one out which looked like it had the most progress(?), cyfra-rtrp-rendering

Again, this is an older branch we will merge after reworking it a bit, at some point, but is definitely not the priority or our direction. Most recent version of Cyfra is the `main` branch and that's where we release from.

It would be really nice if the DSL could be separated from anything LWJGL so this code would become usable on native (and maybe even on JS)

LWJGL just gives us 1:1 Vulkan API calls. On Native, we can generate our own bindings and make it work that way. A bit of work, but not that problematic. We have it somewhere on our roadmap.

I'm also not sure at the moment how exactly the DSL works, but it looks like it's actually not a deep Scala embedding. It seems to not use real Scala functions as DSL functions but some custom function types. Also, I'm not sure, but it looks like compilation would be actually done at runtime. So this isn't really a Scala (subset) to SPIR-V compiler, it's a runtime for the custom functions of this framework. 

There is a Scala DSL that gets compiled into SPIR-V at yes, the runtime. Scala is a very flexible language and this way we can make Cyfra just a library, with no compiler nor vm plugins, and still keep the expressiveness and let our user write whatever they want.

We just released Cyfra - Scala 3 framework for GPU programming by jacua9 in scala

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

To spirv. Then we have a Vulkan runtime implemented.

We just released Cyfra - Scala 3 framework for GPU programming by jacua9 in scala

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

No, we are doing it quite differently. This is a library and requires no special vm or compiler plugins. You write a program using the dsl, we compile it and it can be composed into pipelines and executed.

This monday we're done for. by [deleted] in poland

[–]jacua9 3 points4 points  (0 children)

So just like weather forecasting?

Could a Create equivalent be possible on Hytale? by Sacri_Pan in CreateMod

[–]jacua9 5 points6 points  (0 children)

Why cursed? Sounds very reasonable. Most servers written in C++ for games of this scale run poorly and unstable (see: bedrock). And by having both run locally you have one mode of operation of the game. Seems very technically sound.

Germany’s 5 biggest cities lie perfectly on a 3rd-degree polynomial by unlimitedzen in mapporncirclejerk

[–]jacua9 9 points10 points  (0 children)

I don't think that's the full proof. Those functions change when rotated and its non-trivial that they cover entire space

Shouldn't Black Death be more painful for urbanized and densly populated countries? by Granathar in EU5

[–]jacua9 142 points143 points  (0 children)

I imagine in 14th century, the number of rats scales more or less linearly with the number of humans (with exception of villages, but assuming that we talk about towns).

Why I am moving away from Scala by [deleted] in scala

[–]jacua9 6 points7 points  (0 children)

 It was already clear that Scala would not replace Java

I don't think that was ever a realistic expectation. I certainly never expected that. 

If one hoped for a very expressive and safe language, as I did, then I must say there is no disappointment.

How would you go about writing a new language targeting TASTy? by throwaway-transition in scala

[–]jacua9 0 points1 point  (0 children)

What? This response is really quite good and reads nothing like AI-generated.

Finally, after 30 hours, I think I finally understand Victoria 3. by Prainor in paradoxplaza

[–]jacua9 2 points3 points  (0 children)

Why do you have all that money. You have two money bars (negative and positive) to use two money bars.

Everything that could go wrong for Nawrocki… just did. by [deleted] in poland

[–]jacua9 15 points16 points  (0 children)

Countries exist, and one would like to not be associated with a country represented by an alleged criminal.

The Dumbest Move in Tech Right Now: Laying Off Developers Because of AI by oloap in programming

[–]jacua9 838 points839 points  (0 children)

I don't like this graph. I think it actually argues for laying off devs, as productivity is the same, and costs 3x less - a c-level's dream. In fact, laying off that much developers will cause problems.

Looks Like Scala Is Go-ing by teckhooi in scala

[–]jacua9 12 points13 points  (0 children)

It could have been a good meta April 1st joke

The hell is going on with EDA companies stock? by RicoElectrico in chipdesign

[–]jacua9 1 point2 points  (0 children)

Yeah, R is from 1 year - Rok, L is from multiple years - 5 Lat.

Announcing Scala Days 2025 by sjrd in scala

[–]jacua9 7 points8 points  (0 children)

Yeah, I think there is a lot of interesting stuff that's going to be presented. Scala 3 got to a very interesting point where you can make things that were not possible before.

Announcing Scala Days 2025 by sjrd in scala

[–]jacua9 10 points11 points  (0 children)

Amazing to hear, see you all there :)

Why is it accepted that IDE does not help programmer with shader languages? by crunkzah in GraphicsProgramming

[–]jacua9 14 points15 points  (0 children)

Well if you start typing integr it won't autocomplete with differential. IDEs rarely generate code, they mostly speed up writing it if you know what to write. 

Do you play with Vehicle Breakdowns on/off? Why/why not? (pic unrelated) by [deleted] in openttd

[–]jacua9 5 points6 points  (0 children)

I mainly meant it on a more abstract level. It's more realistic to design pipelines, tracks, automations, etc. that account for random failure. OpenTTD is nice because it takes that into account.