Skip to content

Instantly share code, notes, and snippets.

@BoyBaykiller
BoyBaykiller / BepuPhysicsNativeMinMaxDiffs.md
Created May 21, 2026 00:00
BepuPhysics native min/max diffs

Diffs are based on 29,389 contexts (14 MinOpts, 29,375 FullOpts).

Overall (-120 bytes)
Collection Base size (bytes) Diff size (bytes) PerfScore in Diffs
realworld.run.windows.x64.checked.mch 11,555,829 -120 -0.41%
@BoyBaykiller
BoyBaykiller / DiffsDistributiveArithmeticLclCmp.md
Created April 29, 2026 01:14
Diffs Distributive Arithmetic LclCmp

Diffs are based on 2,490,528 contexts (966,403 MinOpts, 1,524,125 FullOpts).

MISSED contexts: 3 (0.00%)

Overall (-6,312 bytes)

|Collection|Base size (bytes)|Diff size (bytes)|PerfScore in Diffs

@BoyBaykiller
BoyBaykiller / DiffsDistributiveArithmeticGenTree::Compare.md
Created April 29, 2026 01:13
Diffs Distributive Arithmetic `GenTree::Compare`

Diffs are based on 2,490,528 contexts (966,403 MinOpts, 1,524,125 FullOpts).

MISSED contexts: 3 (0.00%)

Overall (-7,470 bytes)

|Collection|Base size (bytes)|Diff size (bytes)|PerfScore in Diffs

@BoyBaykiller
BoyBaykiller / jitdump.lua
Created April 24, 2026 00:07
Dump for https://github.com/dotnet/runtime/issues/124700 (but with last if removed for simplicity)
****** START compiling IDKEngine.Application:Unoptimized(int,int):int (MethodHash=a4b702e1)
Generating code for Windows x64
*************** JitOptRepeat enabled; repetition count: 3
OPTIONS: compCodeOpt = BLENDED_CODE
OPTIONS: compDbgCode = false
OPTIONS: compDbgInfo = true
OPTIONS: compDbgEnC = false
OPTIONS: compProcedureSplitting = false
@BoyBaykiller
BoyBaykiller / lowerAddNegToSub.md
Created April 3, 2026 03:40
lowerAddNegToSub

Diffs are based on 2,542,063 contexts (973,272 MinOpts, 1,568,791 FullOpts).

Overall (+9,918 bytes)
Collection Base size (bytes) Diff size (bytes) PerfScore in Diffs
aspnet2.run.windows.x64.checked.mch 18,909,649 +119 +0.11%
****** START compiling Program.EntryPoint:GetTest(Program.EntryPoint+Vector2,int):float (MethodHash=2b4c0cab)
Generating code for Windows x64
OPTIONS: Tier-0 compilation (set DOTNET_TieredCompilation=0 to disable)
OPTIONS: compCodeOpt = BLENDED_CODE
OPTIONS: compDbgCode = false
OPTIONS: compDbgInfo = true
OPTIONS: compDbgEnC = false
OPTIONS: compProcedureSplitting = false
OPTIONS: compProcedureSplittingEH = false
IL to import:
@BoyBaykiller
BoyBaykiller / AmdMeshShaderCantUseBindlessExtension.md
Last active March 9, 2025 05:29
OpenGL Mesh shader compile error when enabling GL_ARB_bindless_texture

First, I want to thank you for making the effort of implementing Mesh Shaders in OpenGL!

When compiling a mesh or task shader that enables GL_ARB_bindless_texture I get this compiler output:

ERROR: 0:3: 'GL_ARB_bindless_texture' : not allowed when using generating SPIR-V codes
ERROR: 0:3: '#extension' : extra tokens -- expected newline
ERROR: 0:3: '' : compilation terminated
ERROR: 3 compilation errors.  No code generated.

Reproducible:

@BoyBaykiller
BoyBaykiller / AmdBindlessPerformanceOverhead.md
Last active October 25, 2024 20:42
OpenGL Performance overhead of bindless resident textures

Currently, having many bindless resident textures can cause a big performance overhead in the OpenGL driver. Just to give you a rough idea of scale, these are the numbers I am getting in my renderer:

Count Time
0 0.5ms
1_000 0.56ms
2_000 7.8ms
4_000 16.6ms
8_000 58.8ms
@BoyBaykiller
BoyBaykiller / AmdMapReadHostMem.md
Created August 22, 2024 17:42
OpenGL MAP_READ_BIT or MAP_COHERENT_BIT cause buffer to reside in HOST memory even with ReBar/SAM

I've noticed that buffers allocated with GL_MAP_WRITE_BIT or GL_MAP_READ_BIT end up in HOST memory. Example:

uint32_t size = 1 << 22; // 4MiB
uint32_t buf;
glCreateBuffers(1, &buf);
glNamedBufferStorage(buf, size, nullptr, GL_MAP_PERSISTENT_BIT | GL_MAP_WRITE_BIT);
//glMapNamedBufferRange(buf, 0, size, GL_MAP_PERSISTENT_BIT | GL_MAP_WRITE_BIT); // not needed to reproduce

It happens with any other additional combination of flags too. What's interersting is that the memory report of a RX 5700 XT

@BoyBaykiller
BoyBaykiller / AmdCreateDeleteBindlessTextureCrash.md
Last active March 9, 2025 05:21
OpenGL: Creating & Deleting many Bindless Textures without glfwSwapBuffers causes access violation in driver

Running the following code throws an exception (when creating the 1536th texture) from inside the driver: Exception thrown at 0x00007FFC07BFDB20 (atio6axx.dll) in MyProgram.exe: 0xC0000005: Access violation reading location 0x0000000000000008.

I am simply creating a texture making it bindless and deleting it again. If the texture is not made bindless it runs fine. Also putting glfwSwapBuffers always makes it run fine.

for (int i = 0; i < 1600; i++) {
    uint32_t test;
    glCreateTextures(GL_TEXTURE_2D, 1, &test);