Skip to content

Instantly share code, notes, and snippets.

View david-wm-sanders's full-sized avatar
🖋️
up late

David Sanders david-wm-sanders

🖋️
up late
View GitHub Profile
@minimaxir
minimaxir / ur-prompt.md
Last active October 7, 2026 12:02
ur-prompt-20260919

Optimize the Rust and Python bindings in this Rust crate to its maximum potential. Specifically, you MUST make a breakthrough from this current implementation that uses modern concepts and knowledge as of 2026 to further improve this crate without causing ANY significant regressions.

First, before making any library changes, run the Rust and Python benchmarks (and any competitor benchmarks if applicable) to establish a True Performance Baseline for both speed and metric performance. Return the absolute and relative results to the True Performance Baseline to the user as a Markdown table.

Then, optimize the Rust and Python library code such that these benchmarks are atleast 1.2x faster from the True Performance Baseline; ideally as fast as possible, without any significant regressions on quality and prediction error. NEVER hack the benchmarks to accomplish this speed increase, only iterate on the library code. Ensure all benchmark iterations are independent, e.g. NEVER reuse a cache built in

@alice-i-cecile
alice-i-cecile / Bevy Merge Train for 2026-09-14.md
Created September 15, 2026 04:09
Bevy Merge Train for 2026-09-14
  1. Optimize shadow material queuing by caching is_depth_only_opaque (#23834)

+20/-21 for a 40% speed-up in a shadows system? Sign me up! Oh, it's smarter caching. Of course it's smarter caching. One of these days we're going to find a new optimization I promise.

Benchmarks look great (don't merge performance PRs without at least some attempt please...); code is sane, merging.

This is only one small bit of rendering, but we'll chop up this elephant 1000 cuts at a time.

@janhohenheim
janhohenheim / config.toml
Last active June 14, 2026 17:43
My global config.toml setup for ultra fast Rust compile times
[unstable]
codegen-backend = true
[profile.dev]
# Compile using cranelift for massively faster compilation
codegen-backend = "cranelift"
# If you want to attach a debugger, set `debug = true` instead
debug = "line-tables-only"
# Assuming we don't do `catch_unwind`, we can safely abort on panics for some extra perf
# but this often doesn't jive with dependencies, so uncomment this to check if your project still works with it
@cellularmitosis
cellularmitosis / README.md
Last active September 18, 2026 14:22
Some inexpensive Factorio ship designs

Inexpensive Factorio ship and how to design them

Here's an overview of my Factorio ship designs which can be built inexpensively.

See also the Design topics section below.

These ships are designed for use within the first four planets.

⭐️ Recommended ships:

  • The Hornet (the cheapest useful ship)
@ItsDoot
ItsDoot / _description.md
Last active April 19, 2025 01:27
Bevy + egui in a text-based, turn-based adventure game.

Bevy + egui in a text-based, turn-based adventure game.

I won't go too far into the nitty details (lol), but this is generally how I've structured my WIP mostly-text-based, turn-based adventure game. I emphasize that because I suspect this approach doesn't work all that well for other styles of games. Specifically, because practically everything in my game happens on-click; there's very little running in the background.

TL;DR?

Nah, I strained my eyes for this.

@leddoo
leddoo / reg_vm.rs
Created December 29, 2022 11:03
a very simple register vm
// a very minimal instruction set.
// it has just enough operations to implement a recursive
// fibonacci function - what a coincidence :D
// NOTE: in my VM, i don't use an `enum`.
// this is just for simplicity.
#[derive(Clone, Copy, Debug)]
enum Instruction {
LoadInt { dst: u8, value: i16 },
Copy { dst: u8, src: u8 },
Add { dst: u8, src1: u8, src2: u8 },
@h3r2tic
h3r2tic / restir-meets-surfel-lighting-breakdown.md
Created November 23, 2021 02:15
A quick breakdown of lighting in the `restir-meets-surfel` branch of my renderer

A quick breakdown of lighting in the restir-meets-surfel branch of my renderer, where I revive some olde surfel experiments, and generously sprinkle ReSTIR on top.

General remarks

Please note that this is all based on work-in-progress experimental software, and represents a single snapshot in development history. Things will certainly change 😛

Due to how I'm capturing this, there's frame-to-frame variability, e.g. different rays being shot, TAA shimmering slightly. Some of the images come from a dedicated visualization pass, and are anti-aliased, and some show internal buffers which are not anti-aliased.

Final images

@david-wm-sanders
david-wm-sanders / rwr_settings_snippet.xml
Last active June 16, 2022 17:38
RWR settings.xml controls explained
<keyboard_controls>
<!-- UP: W (0x11) -->
<control0 value="17" />
<!-- DOWN: S (0x1F) -->
<control1 value="31" />
<!-- LEFT: A (0x1E) -->
<control2 value="30" />
<!-- RIGHT: D (0x20) -->
<control3 value="32" />
<!-- RELOAD: R (0x13) -->
@haram
haram / be_fn.hpp
Last active March 2, 2026 11:44
Replicate BattlEye initialization to dump data out of it
#pragma once
#include <stdint.h>
#include <stdio.h>
namespace be
{
void print_message( const char* msg )
{
printf( "[BATTLEYE] %s\n", msg );
}
@haram
haram / decrypt.cpp
Created June 20, 2020 02:51
Escape From Tarkov encryption defeated
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
// yousif, namazso, can1357, defcon42
namespace packet
{
constexpr size_t be_xor_key = 0xd774f59d;