What's everybody working on? (September Edition)

What symbols are you using in that tree before the words?
My browser/font doesn’t know them and doesn’t have a fallback.


there isn’t suppose to be a symbol I don’t really know why it made something weird ahah

Hi guys,

I’m quite new to Zig, actually I have not much coding experience.
Currently, I am working on a NES emulator project to learn Zig, and I’ve found out I’ve made the perfect choice of language for this kind of project.

Love Zig!

If you’re interested, here’s the repo.

7 Likes

I recently updated keywisp(A small Wayland keystroke visualizer) — added shadow option support, and redesigned the wisp-dark/wisp-light theme with raised keycaps and configurable shadow effects.

15 Likes

Currently took a break from my usual projects to learn 3D graphics from scratch.
I’ve always been fascinated by graphics and it feels like sorcery to me, so I decied to learn the math behind it and build some software renderers.
Below you can see my first ever rendered image with a software ray tracer.
The idea is to understand the difference between ray tracing and rasterisation by implementing both of them via software.
Then, it would be cool to interact directly with the GPU, but I still need to figure out if I should use
Vulkan, OpenGL, DirectX or Metal; it would be awesome to use the “lowest level” API (which should be Vulkan?) to really understand GPUs and use them correctly and efficiently.
Please let me know if you have any advice on this, I’m a noob in graphics so tips and tricks are welcome :))

3 Likes

working on some dvui patches. more text/font features (harfbuzz freetype swash zig clone), platform support and cross compiling (testing on real mobile devices, fun fun fun). if any one could answer Canonical Cross Compiling w/ System Dependencies, PKG Config, --sysroot and --search-prefix? i would be really greatful!

1 Like

None of these are really “more” low level than the other ones, these days they all mainly act as an interface over the programmable shader pipeline and a way to transfer data from RAM to VRAM and vice versa
I know there’s a weird GPU assembly language you can write, but I don’t know almost anything about it

Still, Vulkan would probably be your best bet since the format its shaders compile into is SPIR-V, which is a reasonably well documented binary format which Zig code can even compile to.

A quick brief on ray tracing through these APIs - I don’t know a lot about it, but DX12/Metal/Vulkan all seem to work basically the same way, where it’s a special type of shader which is primarily implemented in driver code, and you need to call functions to set up an acceleration structure that you add triangles to, and then write shaders for first hit/passthrough. (Passthrough, for transparent materials.)
I think the way you do shadows is that the first hit shader is allowed to emit rays (kind of like a geometry shader emitting vertices), so you just shoot a new ray at every light source in the scene or something.

2 Likes

Thanks a lot for this, it all sounds really interesting and helpful!
Can’t wait to finish my software renderers and get into GPUs :smiley:

If you are truly crazy (and have access to a Linux box), the lowest level you can access through userspace is interacting directly with the GPU kernel driver, by sending the correct ioctls to the correct device. That’s what Mesa does to implement OpenGL and Vulkan!

https://www.kernel.org/doc/html/latest/gpu/
https://www.kernel.org/doc/html/latest/gpu/drm-uapi.html

Good luck with your 3D graphics endeavours, and have fun!

5 Likes

statusbar, a small status bar for any terminal. You can even update it with starship.

8 Likes

I’m still working on loaderx, a high-performance data container. The biggest change in September is probably that I implemented bidirectional zero-copy data transfer between storage and GPU (based on dma-buf). Although it doesn’t completely bypass the CPU like NVIDIA GDS, this is the only thing that can be done while remaining hardware-vendor-neutral.

Second, this bidirectional transfer can integrate seamlessly with torch/jax. Overall, this satisfies me. However, most of the project is done in Python, while Zig supports the most core concurrency and low-level primitives.

https://codeberg.org/eoelab/loaderx

2 Likes

I want to show my small service that I finally feel good about to display. I wrote it for myself since I wanted something to dynamically switch and endpoint when I’m changing the network for my wireguard traffic. So, it does that.
When a packet from the endpoint does not arrive in specified period, it selects a new endpoint that accepts packets from based upon previous recorded state of the endpoint with a failover timer to increase frequency of switching till it finds one that works.

main branch is how I started writing it with Zig 0.15.2, with out the knowledge of the atomics and mutex existing at all. No AI used.
0.16.0 branch, I’m using atomics and I changed the logic so that I don’t have to rely on PersistentKeepalive flag in wireguard to work. AI is not used there as well. It’s the last edited branch that I felt good to share after all the time I spent on this now.
feat.admin_server branch is the one where I swapped to mutex in order to implement and admin server that changes variables at runtime. Basically add, remove, edit, find endpoints, get status from the running service. I tired using AI for tests there, which I ended up refactoring too many times. I translated to Zig Neri/Schneider timestamp calculation with out much of understanding how it works still. Tests there as well are written with AI and I did not change them since I still lack the ability to grasp Neri/Schneider. That’s why 0.16.0 branch does not have that fancy algo for timestamps.

Here is 0.16.0 branch in case anyone wants to take a look.
Thank you to anyone who is willing to :blush:

4 Likes

After asking for a pair on ziggit, @nathanielketema and I have slowly been working on Photostatic: A tool that turns an Instagram data export into a static website.

It’s now to a point that it “works” by some hacky definition, but there’s still a lot of polish to do. It’s been great pairing I think I we’re both learning a lot from each other.

9 Likes

Couldn’t agree more. It’s been a blast pairing with you!

3 Likes

Restructureing my music theory trainer (again). Maybe I will be satisfied with the underlying architecture this time.

3 Likes