~ / cmdr2

projects: freebird, easy diffusion

hacks: carbon editor, torchruntime, findstarlink

  # filter by: [ posts | worklogs ]
  • #easydiffusion
  • #stable-diffusion

// Cross-posted from Easy Diffusion’s blog. Spent a few days getting a C++ based version of Easy Diffusion working, using stable-diffusion.cpp. I’m working with a fork of stable-diffusion.cpp here, to add a few changes like per-step callbacks, live image previews etc. It doesn’t have a UI yet, and currently hardcodes a model path. It exposes a RESTful API server (written using the Crow C++ library), and uses a simple task manager that runs image generation tasks on a thread. The generated images are available at an API endpoint, and it shows the binary JPEG/PNG image (instead of base64 encoding).

Wrote a simple hex-dumper for analysing dll and executable files. Uses pefile.

  • #car
  • #simulation
  • #game
  • #drs
  • #featured

Continuing on the race car simulator series. Last week, the “effective tire friction” calculation was implemented, which modeled the grip at the point of contact between the tire and the road surface. This intentionally did not take into account the vertical load (or any other forces), since the purpose was limited to calculating the “effective” friction coefficient based on the material conditions. The next step was implemented yesterday, which calculates the effective force the tire will apply on the wheel axle, in reaction to the torque applied by the engine on the wheel axle. That reaction force will cause the car to move forward. It also factors in the existing inertial force (i.e. if the car is already moving) in order to model sideways slip (e.g. for drifting).

  • #findstarlink

Following up on yesterday’s post, there’s now full automation for the conversion of provisional NORAD IDs to the official one (once they’re available in Celestrak). This automation is still waiting to be deployed, because it needs to be tested with the official NORAD IDs for yesterday’s Starlink launch (G6-77), once they’re assigned next week. This automation has been now been deployed. So now, the only processes still done manually are (a) selecting a new leader for a train, if the current leader drifts away from the train, and (b) removing old trains that have spread out completely.

  • #findstarlink

Spent two days automating some of the processes around findstarlink.com, and updating some of the code that had started bit-rotting. Most of FindStarlink’s operations run as individual AWS Lambda functions, that are triggered periodically by CloudWatch Events (and Schedules). But a few processes are still done manually, mainly due to a mix of laziness and also being a bit tricky to automate. I also needed to migrate the existing automations to a newer NodeJS runtime in AWS Lambda, since the current runtime was nearing end-of-life support.

  • #car
  • #simulation
  • #game
  • #drs
  • #featured

Started building a car simulator, focused on F1-like car characteristics. It’s reasonably detailed in terms of simulation, but is ultimately meant for games/machine learning, so it approximates some of the behavior. It isn’t physically accurate. The first piece is the car simulator itself - https://github.com/cmdr2/car-sim. This module is a numbers-only simulation, i.e. it doesn’t handle visualization, interaction or anything that’s not related to the simulation of vehicle components. I’ve started from the point of contact between the tire and the road, and will work backwards from that. I’ve got a basic tire friction model working, which computes the “effective friction” against the track surface, by taking into account: tire material, tread amount, road type, road condition, tire width, tire hardness, tire pressure, tire temperature, tire wear and tire camber.

  • #freebird

// Cross-posted from Freebird’s blog. tl;dr - Today I shipped the ability to see the desktop screen in VR (while using Freebird). And fixed a few user-reported bugs in Freebird. Performance The performance is still a bit laggy. The actual screencapture code now runs in a separate process, and copies data over a SharedMemory buffer (which works pretty well for sharing data between two separate processes). That helps avoid Python’s GIL while performing numpy operations on large arrays.

  • #freebird

// Cross-posted from Freebird’s blog. Built an initial prototype of showing the desktop window screencapture inside VR (while in Freebird), using the mss library. Freebird will have to install it using subprocess.run([sys.executable, '-m', 'pip', 'install', 'mss']). It works, but is currently a bit laggy. The capture and processing happens on a thread, and a timer modal calls the actual GPU texture assignment. The GPU texture assignment takes about 2 ms, but the XR view is still juddering (way more than it would with an extra 2ms of latency). Still need to investigate and smoothen the performance.

  • #blog-engine
  • #dropbox
  • #aws
  • #lambda
  • #s3
  • #featured

Finished the blog-agent project for now. The blog is now live, and the code is up at the GitHub project. In summary, it lets me write my notes as text files in Dropbox, and it automatically formats and publishes it as a blog on S3. It runs by triggering an AWS Lambda function via a Dropbox webhook. It’s built purely for a workflow that I’m very used to (writing notes in text files, one file per month, posts separated by two hyphens padded with line breaks). But making this a public project will probably force me to keep things well-documented (so that I can fix things easily, if they break in the future).

  • #blog-engine
  • #dropbox
  • #aws
  • #lambda
  • #s3

Updated the flat_blog generator, and modified the blog-agent to use Dropbox Refresh tokens to get new auth tokens. Also made it auto-generate an index.html, and added styling for the list of posts. The idea is to make it look a bit more like a twitter feed, and less like a list of links. Still not fully there yet.