14 votes

What programming/technical projects have you been working on?

This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?

20 comments

  1. SethBling
    Link
    I'm writing a Minecraft mod that imports a Java rigid body physics engine and using that engine to create a 3-D version of Angry Birds in Minecraft. It's a server-side mod, so vanilla clients can...

    I'm writing a Minecraft mod that imports a Java rigid body physics engine and using that engine to create a 3-D version of Angry Birds in Minecraft. It's a server-side mod, so vanilla clients can connect and play.

    10 votes
  2. [4]
    NoobFace
    Link
    Working on a fully IAC/GitOps home kubernetes cluster. Never used kube before. Learning curve is asymptotic. Stuff is up, but the volume of abstractions is like swimming in air. It feels like I'm...

    Working on a fully IAC/GitOps home kubernetes cluster. Never used kube before. Learning curve is asymptotic.

    Stuff is up, but the volume of abstractions is like swimming in air. It feels like I'm flailing a touch.

    6 votes
    1. creesch
      Link Parent
      Oh yeah Kubernetes is abstraction hell as far as I am concerned. Also probably overkill for 80% of the places where it is used.

      Oh yeah Kubernetes is abstraction hell as far as I am concerned. Also probably overkill for 80% of the places where it is used.

      5 votes
    2. [2]
      bo0tzz
      Link Parent
      Maybe you've already found them, but both https://kubesearch.dev/ and the Home-Ops discord community are very helpful when you're finding your way in this!

      Maybe you've already found them, but both https://kubesearch.dev/ and the Home-Ops discord community are very helpful when you're finding your way in this!

      2 votes
      1. NoobFace
        Link Parent
        Thanks. kubesearch has been helpful. I'm in Home Ops, but I'm not quite over the RTFM hump.

        Thanks. kubesearch has been helpful. I'm in Home Ops, but I'm not quite over the RTFM hump.

        1 vote
  3. [2]
    TangibleLight
    Link
    Making my nth attempt at learning Vulkan on the side out of an interest in rendering engines. I've known OpenGL fairly well for many years now, but always frustrated by the state machine and heard...

    Making my nth attempt at learning Vulkan on the side out of an interest in rendering engines. I've known OpenGL fairly well for many years now, but always frustrated by the state machine and heard good things about Vulkan. All my prior attempts, being hobby projects, have failed somewhere in the swapchain and render pass setup. Why go through the trouble when OpenGL is right there?

    This attempt seems to be going better. These diagrams have been invaluable. Pieces are starting to fit into place and I feel I'm starting to grasp the big picture of things.

    Behold, my greatest achievement: a red box, produced with nothing but the Zig compiler and my bare hands. All written without reference, so I think I'm in good shape!

    Well, not nothing but the Zig compiler. The binding generator and dynamic loader Snektron/vulkan-zig. And GLFW C interface. Dynamically loading libraries and platform-specific windowing APIs are not really something I'm interested in dealing with, especially not for a hobby project.

    6 votes
    1. TangibleLight
      (edited )
      Link Parent
      Back at my PC with a bit more time to talk about this. I say my greatest achievement is a red box, but this is obviously reductive. I think it is a very well behaved red box. Some things I'm...

      Back at my PC with a bit more time to talk about this.

      I say my greatest achievement is a red box, but this is obviously reductive. I think it is a very well behaved red box.

      Some things I'm trying to do correctly:

      • Smooth rendering while resizing the window
      • Triple buffering
      • Proper command pool management and single-shot command buffers
      • Validation layers and debug messages
        • Integrate with Zig std.log and Safe/Fast optimization levels.
        • Everything seems compliant, even while rebuilding the swapchain. This was not the case when I followed https://vulkan-tutorial.com/ or https://vkguide.dev/. Resizing the window interrupted rendering and/or caused various validation errors and/or deadlocked the program.
      • Input event bus
        • Zig tagged unions here are nice, instead of glfw's global callbacks.
        • Currently just an ArrayList. Some SoA structure might be better in practice, but I'm not bothering for now.
      • No leaking memory or Vulkan objects.
      On the event bus

      In my past projects I try to be "reactive" and handle events as they come with the GLFW callbacks. This always ends up a nightmare and severely limits my attempts at parallelization; all events originate from the main thread when glfwPollEvents or similar are called, so I'd end up building these little synchronized event buffers everywhere that caused issues. I'm hoping a global buffer will be fast and make handling events on appropriate threads possible.

      I've also thought about making a general event bus for application events. A big mmap ring buffer could be fast, but I'm not sure if this is a good idea or not. If I do want to pursue multithreading I'll need to handle thread communication one way or another. An event queue seems reasonable enough but I'm not sure how that shakes out in practice. What I've gathered from research online is that things tend to use a big global event buffer and that's it... this is surprising to me but I'm not sure.

      On the swapchain and bad tutorials.

      In past attempts at Vulkan, inspired by those tutorials, the swapchain has always been a nightmare, especially to smoothly handle window resizing. The guides I'd seen have this flow like:

      1. Acquire the next image
        • If it's out of date
          • rebuild the swapchain
          • rebuild sync primitives
          • acquire a new image
            • If that image is out of date, drop the frame.
          • record triple-buffered command buffers
      2. Submit command buffer
      3. Present the image
        • If it's out of date (it probably is)
          • rebuild the swapchain
          • rebuild sync primitives
          • acquire a new image
            • if that image is out of date (it probably is), drop the frame
          • record triple-buffered command buffers
      4. Poll events

      Steps "rebuild the swapchain" and "rebuild sync primitives" are doing a lot of heavy lifting here. If you don't do the sync primitives right, your program deadlocks or fails validation. There's all this state you need to manage about the current handle and the previous handle. Sync primitives get invalidated and confused with triple buffering. and and and.... in the past this is where I'd give up.

      My insight this time is: Just keep the create info around, and poll events at the top of the loop. State management and synchronization problems are gone.

      1. Poll events
        • If the framebuffer changed size, set handle = .null_handle
      2. If handle is null
        • Update info.image_extent
        • Rebuild the swapchain and set handle
        • Set info.old_swapchain = handle
      3. Acquire the next image
        • If that image is out of date (I don't think it can be)
          • Set handle = .null_handle and drop the frame.
      4. Reset triple-buffered command pool
      5. Record single-shot command buffers
      6. Submit commands
      7. Present the image
        • If that image is out of date (I don't think it can be)
          • Set handle = .null_handle and drop the frame.

      The resulting code is flatter. There's only a fraction of the state management (handle, info, images, and views). You never have to rebuild sync primitives. Triple buffering the command pools is easier. You can also maintain a "global" command pool that contains reused command buffers, but it's not required as in the guides. You never record a command buffer you don't end up submitting.

      If any Vulkan gurus are out there, I'm curious if you see any issues with this. Are there any references that get this stuff right?

      5 votes
  4. Sage
    Link
    I'm having fun with Astro/Vue for a personal project for a community I'm a part of. I chose Astro because I wanted to mess around with it for fun, and I already knew Vue somewhat. I have to say...

    I'm having fun with Astro/Vue for a personal project for a community I'm a part of. I chose Astro because I wanted to mess around with it for fun, and I already knew Vue somewhat. I have to say the CLI for Astro is absolutely fantastic and I have never had such a smoother experience getting everything set up.

    I've also been messing around with Tailwind and really trying to make things look "pretty", and while I didn't like Tailwind initially, I think once I understood it more I have grown to like it.

    All in all it's been a pretty successful and fun project so far with a lot of learning. I look forward to sharing it with the community it's for and to get their thoughts, but I need to polish a few more things.

    4 votes
  5. [2]
    brogeroni
    Link
    I'm making a product to get shoutouts during a livestream (twitch, etc) when you buy merch from their shopify store while they're live. Just a prototype for now, but it'd be very appreciated if...

    I'm making a product to get shoutouts during a livestream (twitch, etc) when you buy merch from their shopify store while they're live.

    Just a prototype for now, but it'd be very appreciated if anyone here wants (or knows someone who wants) to test this!

    4 votes
    1. Weldawadyathink
      Link Parent
      Is this like a more widely available version of the merch messages that LTT created for their livestreams?

      Is this like a more widely available version of the merch messages that LTT created for their livestreams?

      1 vote
  6. themagiulio
    Link
    I'm building a data visualization platform similar to Datawrapper as a portfolio project using Django, D3, Bootstrap and htmx. The webapp is supposed to work in the following way: upload the data,...

    I'm building a data visualization platform similar to Datawrapper as a portfolio project using Django, D3, Bootstrap and htmx. The webapp is supposed to work in the following way: upload the data, create the chart, customize the design and embed it into your website.

    4 votes
  7. Carrow
    (edited )
    Link
    The Bazarr devs responded to my PR, I needed to rebase the recent changes since it has been waiting a while and they had a good refactor suggestion. I'm not good with git so figuring out the...

    The Bazarr devs responded to my PR, I needed to rebase the recent changes since it has been waiting a while and they had a good refactor suggestion. I'm not good with git so figuring out the rebase was a headache. When I went to test, a dependency issue popped up, I'm not really sure how it happened. But I figured it out, a package was deprecated and the other package that absorbed its functionality was not updated in apt to include the deprecated libraries. So I had to force the venv to take pip and update the package in there. I had to dash before I could finish testing, I ought to finish that before I head out of town.

    4 votes
  8. [3]
    Delta0
    Link
    Working on switching over from Arch from Windows. The new Plasma desktop is great

    Working on switching over from Arch from Windows. The new Plasma desktop is great

    4 votes
    1. [2]
      PopeRigby
      Link Parent
      What made you switch to Arch?

      What made you switch to Arch?

      1 vote
      1. Delta0
        Link Parent
        I've been trying several times for the last 2 years but the state of Wayland made my change back. But the recent thing was Windows Recall. It wasn't even about the privacy anymore. I realized...

        I've been trying several times for the last 2 years but the state of Wayland made my change back. But the recent thing was Windows Recall. It wasn't even about the privacy anymore. I realized Windows won't even invest in fixing their existing UI, settings experience, or be consistent with anything and chase dumb AI trends to make us into a better product.

        4 votes
  9. skybrian
    Link
    My property-based testing library for JavaScript (Typescript) is coming along nicely. Still haven't gotten to shrinking yet, but I'm recording the picks made in each playout (which is what I'm...

    My property-based testing library for JavaScript (Typescript) is coming along nicely. Still haven't gotten to shrinking yet, but I'm recording the picks made in each playout (which is what I'm calling a test data generator run) in preparation.

    I also wrote a basic depth-first search that can iterate over all possible variations of an Arbitrary, instead of choosing randomly. This would be kind of absurd for most Arbitraries that have a huge number of possible variations, but it's nice for testing small examples.

    The entry point for the test runner is called repeatTest and I'm thinking of giving the library the same name. It's almost like using a while loop, and I might have it switch to iterating over all variations if the Arbitrary is small enough. There's little point in running a test a thousand times when there are only a hundred possibilities.

    3 votes
  10. caliper
    Link
    Rewriting a Kodi add-on. I was forced to switch to a different ISP a month ago, which meant we lost IPTV from the previous one. Instead of paying money to the new ISP for a similar subscription, I...

    Rewriting a Kodi add-on. I was forced to switch to a different ISP a month ago, which meant we lost IPTV from the previous one. Instead of paying money to the new ISP for a similar subscription, I wanted to do Kodi. I found an abandoned plugin for the new TV streaming service I picked, but it was no longer working.

    First thing I fixed was the EPG. I then started refactoring the plugin because a lot of it I wasn’t going to use. That led me to merge a bunch couple related plugins into one, which is already an improvement. Because this service also offers limited VOD, I’ve now been working on including those in the library and having scrapers add fancy info and images.

    This project has gotten way out of control, but it’s fun. I’d never written anything for Kodi and hadn’t even used it, so it’s been a steep learning curve. I hope to finish it this weekend or the next and publish it when it’s done.

    3 votes
  11. [2]
    RheingoldRiver
    Link
    Wrote a blog post trying to explain one-to-many relations in RDBs (inside of MediaWiki software). This is the kind of thing that (imo) once you know it, it becomes hard to comprehend not...

    Wrote a blog post trying to explain one-to-many relations in RDBs (inside of MediaWiki software). This is the kind of thing that (imo) once you know it, it becomes hard to comprehend not understanding it and as a result I found this post very hard to write, I spent a couple weeks on it & rewrote parts multiple times. I hope it came out okay!

    2 votes
    1. jmpavlec
      Link Parent
      I read through most of it, it made sense to me and was well written! I already understood the concept but I think it would help a newbie. I was a bit surprised to see names were used for joins...

      I read through most of it, it made sense to me and was well written! I already understood the concept but I think it would help a newbie. I was a bit surprised to see names were used for joins rather than IDs. Is that typical of this DB language? I think a diagram or two after splitting the tables could also be helpful to drive the point home.

      Great writeup!

  12. lily
    Link
    Still working on my video game I posted here, like, a year ago (very slowly). I've been trying to get it working better on Wayland, specifically regarding display scaling - I'm having trouble...

    Still working on my video game I posted here, like, a year ago (very slowly). I've been trying to get it working better on Wayland, specifically regarding display scaling - I'm having trouble keeping a 1:1 pixel scale, since ignoring the DPI like that doesn't seem to be something you're supposed to do.

    2 votes