Chris Blume's Avatar

Chris Blume

@programmax.net

Retired software engineer. Volunteering as chair for the W3C PNG Working Group. Formerly Google & Twitch.

161
Followers
73
Following
450
Posts
20.11.2024
Joined
Posts Following

Latest posts by Chris Blume @programmax.net

Do you know if videos will be posted?

07.03.2026 01:49 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Post image

Got Lempel-Ziv compression working.
Now to combine it with the Huffman from before to get Deflate.

This is how Lempel-Ziv compresses Green Eggs & Ham.
The numbers inside the parentheses are the offset from the start and the length.

(5, 3) is the "Sam" it saw before.
(0, 4) is the "I am".

06.03.2026 14:33 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Also, gross. I uploaded a PNG.

Bluesky decided to recompress as a JPG. Fair enough. I think it is a good idea to do a lossy compression for the human-presentation step.

But it didn't take the image dimensions vs display dimensions into account. Gross artifacts everywhere.

06.03.2026 10:05 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Join us for 3D on the Web on March 11 in San Francisco

Join us for 3D on the Web on March 11 in San Francisco

Calling all programmers!

Khronos Group is hosting "3D on the Web" -- an evening of talks, demos & networking around #WebGL #WebGPU, #glTF & #Gaussian splats.

March 11 ยท 5:30-9:30 PM PDT
Easy 12 minute walk from GDC in
San Francisco

Learn more and register [โ€ฆ]

[Original post on fosstodon.org]

06.03.2026 00:01 ๐Ÿ‘ 5 ๐Ÿ” 2 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Post image

I feel like that might be a new one for me.

06.03.2026 09:59 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

The guy wasn't aware. Few are.
Sounds like the guy in your video also didn't know.

However, I'm curious about California's offset allowance.

04.03.2026 18:57 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

I had a guy knock on my door trying to sell a solar install.
He claimed he could get my bill to zero.

I had been researching a bunch and do want solar. So I asked him details.
"Half of my bill is the actual energy. The other half is grid maintenance. In Ohio, you can only offset energy, right?"

04.03.2026 18:56 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

It it was my choice and I'm the pilot, 100% "Jesus, take the wheel"

03.03.2026 22:54 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

*correction (it was late, I was tired):
This IS a prefix tree. The only nodes with values are leaf nodes.
What I meant is this is kinda right-leaning. See how the bottom right filled up? Typical Huffman implementations are left-leaning.
It doesn't matter--just produces a different bitstream.

03.03.2026 18:28 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

*Technically, Huffman trees should be prefix and what I made here is suffix.

It still works the same. But this implementation will produce a different bitstream than the typical Huffman encoder.

03.03.2026 08:14 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Ahh that makes sense.

I still don't love it. :) But it makes sense.

03.03.2026 08:11 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Post image

Finally getting around to writing my own compression implementations.

Got a naive Huffman compression going.
Had to take some notes while debugging.
LZ77 next.

03.03.2026 08:10 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Also utf8'X' would have been SO MUCH BETTER than u8'X'.

In any other language, u8 is shorthand for uint8_t.

03.03.2026 06:53 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

To clarify a bit:
Originally, prefixes only changed the representation in the code. Suffixes changed only the type.

So there was some logic.

But then u8'X' was added--a prefixes that specify type.

Also, guess how you specify the type uint8_t.
Did you think Xu8? Nope. Maybe u8X? Nope.There is none

03.03.2026 06:45 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

I love C++.
But uh...the literal situation is a mess.

0xXXX for hex.
0bXXX for binary. Many similar prefixes.
u8'X' for a unsigned char 8, another prefix.

XXXll for long long. Suffix. Many more.
XXXs for seconds.

XXX_foo for user-defined literals. Gotta use a _.

It could be XXXb for binary...

03.03.2026 05:56 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

I'm sure they don't think about it at all,
but it keeps crossing my mind...

I explained to several managers that I was drastically under-leveled. I'm pretty sure they thought I was lying.

Having quit and retired, have they since "huh."?

27.02.2026 22:13 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Next thing might be adding collision? *shrugs* We'll see.

26.02.2026 06:27 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Video thumbnail

February is almost over. Sit rep:
I added a state machine for the player and am feeding it input. So now there is a "running left" state, for example.

I also cleaned up a bunch of animation code. But I didn't add frame timing yet. So the player's animations are way too fast.

26.02.2026 06:26 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Auto-type members

If you're interested when you wake up:

It had already been proposed and debated. And a test change to clang was made. There are some good reasons not to allow it, which I didn't see.
open-std.org/jtc1/sc22/wg...

22.02.2026 23:09 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Thank you, Hana. I genuinely appreciate your help. <3

22.02.2026 21:36 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

I think my example of lambdas is weak. It only works when the default initializer is used.

The lambda's type cannot be used outside of that. So nothing could match (without a std::function-style workaround).

So that argument isn't strong. Almost entirely for ease then (barring reflection).

22.02.2026 21:00 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

See also this:
bsky.app/profile/prog...

22.02.2026 20:36 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Correct.
And if the default initializer isn't used, the type is still deduced from it.

22.02.2026 20:31 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

Fun fact:
You *CAN* do this:

auto baz() { ... }

class Foo { decltype(baz) bar = baz(); }

That is more explicit about what the type is, regardless of the default initializer.
So what I want is the default initializer to be able to instruct 'auto', even when it isn't used.

22.02.2026 20:30 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 1

There are workarounds. You could use std::function instead of a lambda.

But
1.) I don't think we should stop at "workaround" rather than fix the core language restriction. We didn't with function auto return types. And,
2.) Even with the workaround, I don't want to specify the type here.

22.02.2026 18:45 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

There is a thing I wish C++ supported. Might be time to finally write a proposal?

class Foo { auto bar_ = baz(); };

We have 'auto' return types for functions. It is a hard requirement if you're returning a templated type involving a lambda.
It is also a hard requirement here.

22.02.2026 18:42 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

In WoW there are truffle pigs.
They are idle (state 1) until you summon them over to dig (state 2). Once they arrive, they dig (state 3) and then return (state 4)

At each state, they might get attacked. After the attack, they return to that state. So we need 4 more "attack" states with typical JUMP

21.02.2026 16:10 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Is there a standard name for combining state machines and stacks?

Example in reply. But tl;dr most state transitions are effectively a JUMP. I want to also CALL & RET.

21.02.2026 16:07 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 3 ๐Ÿ“Œ 0
Video thumbnail

Theeere we go.
Got a player sprite working.

14.02.2026 17:28 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

FRIGGIN'...

A triangle wasn't rendering. My default was to check winding order. Seemed the same as others?

I changed the order just in case and it worked!
Fair enough.

But also, the triangle was upside-down.
I forgot DX is -Y down. My winding order would have been correct in -Y up.

14.02.2026 16:04 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0