Tavian Barnes's Avatar

Tavian Barnes

@tavianator.com

Aspiring computer scientist

130
Followers
584
Following
33
Posts
01.03.2024
Joined
Posts Following

Latest posts by Tavian Barnes @tavianator.com

Screenshot of text:

Frequently Asked Questions
Can I book my flight through an agency or travel agent?
Flair Airlines does not sell tickets through agents or third-party websites.  Always book at flyflair.com.  We do (statement above is false), through google flights and expedia and others, we should clarify here that the thing that you should verify it's a trusted agency

Screenshot of text: Frequently Asked Questions Can I book my flight through an agency or travel agent? Flair Airlines does not sell tickets through agents or third-party websites. Always book at flyflair.com. We do (statement above is false), through google flights and expedia and others, we should clarify here that the thing that you should verify it's a trusted agency

Screenshot:

please type "confirm" to proceed

confirm

this is an invalid value

confirm cancellation (disabled button), cancel

Screenshot: please type "confirm" to proceed confirm this is an invalid value confirm cancellation (disabled button), cancel

Flair Airlines, the budget airline with the even more budget website

15.01.2026 01:27 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Post image

... ask HISTORIANS???

20.08.2025 11:39 πŸ‘ 7 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Sneaky git commits - tavianator.com

New (short) blog post: sneaky git commits

tavianator.com/2025/sneaky....

10.08.2025 14:57 πŸ‘ 3 πŸ” 2 πŸ’¬ 0 πŸ“Œ 0

Nah man rent used to actually be lower

01.07.2025 16:37 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Fast, Branchless Ray/Bounding Box Intersections, Part 3: Boundaries - tavianator.com

imo the third post is better: tavianator.com/2022/ray_box...

27.06.2025 17:22 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Taking the C preprocessor to Church - tavianator.com

A brief history and (ab)use of __VA_OPT__: tavianator.com/2025/cpp_chu...

26.06.2025 18:38 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

38 seconds total, if you read the whole line.

Anyway I'm not suggesting that an "actual project" spend time on this, but maybe a build system should?

27.04.2025 17:35 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Parallel ./configure - tavianator.com

New blog post: parallel ./configure

tavianator.com/2025/configu...

25.04.2025 17:06 πŸ‘ 4 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Still no sound from my laptop speakers, but at least I won't trigger a UAF anymore while I try to debug it: lore.kernel.org/linux-sound/...

23.04.2025 15:19 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Keep going? No, fail fast!

14.04.2025 15:52 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

I could reproduce the phenomenon with only 14 instructions on #Intel #GoldenCove, #RaptorCove, #RedwoodCove. It appears only with the 64b-immediate initialization of the 2nd (3rd) operand in the -1024<=imm32<=1023 range.

On #LionCove... 1/2

08.01.2025 18:32 πŸ‘ 4 πŸ” 2 πŸ’¬ 1 πŸ“Œ 1
The Alder Lake anomaly, explained - tavianator.com

And the explanation: tavianator.com/2025/shlxpla...

04.01.2025 19:08 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
The Alder Lake SHLX anomaly - tavianator.com

New blog post: tavianator.com/2025/shlx.html

02.01.2025 22:17 πŸ‘ 4 πŸ” 3 πŸ’¬ 1 πŸ“Œ 1

Re-measured it: the prefetch is still a significant improvement, ~11% higher throughput at 8 threads, ~30% higher at 12 threads. I should probably write this up somewhere

02.01.2025 15:36 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

In both cases the counters claim 1 uop, so I don't think so

31.12.2024 22:55 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

It's fast for me in practice on Zen 2 at least. Maybe someday I'll microbenchmark it. But also I've dramatically optimized the MPMC queue recently, not sure the prefetch still makes a difference

31.12.2024 22:53 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Preview
uops.info Alder Lake-P latency for SHLX Β· Issue #33 Β· andreas-abel/nanoBench https://uops.info/html-instr/SHLX_R64_R64_R64.html#ADL-P lists SHLX as having 3-cycle latency for both operands. This is in contrast to Intel's docs and InstLatx64's measurements. So what gives? I ...

I wrote more details here: github.com/andreas-abel...

31.12.2024 20:12 πŸ‘ 5 πŸ” 4 πŸ’¬ 1 πŸ“Œ 0
Preview
uops.info Alder Lake-P latency for SHLX Β· Issue #33 Β· andreas-abel/nanoBench https://uops.info/html-instr/SHLX_R64_R64_R64.html#ADL-P lists SHLX as having 3-cycle latency for both operands. This is in contrast to Intel's docs and InstLatx64's measurements. So what gives? I ...

I wrote more details here: github.com/andreas-abel...

31.12.2024 20:12 πŸ‘ 5 πŸ” 4 πŸ’¬ 1 πŸ“Œ 0

Okay new discovery: "MOV R10D, 1" also gives 1c latency. But "MOV R10, 1" gives 3c latency. Something to do with whether the top half of the count register is zeroed and how.

31.12.2024 19:42 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Preview
Compiler flags of GCC/CLANG to generate "BEXTR" instruction (of IA32's BMI1) I am looking for compiler flags of GCC/CLANG to generate BEXTR instruction. template &lt;auto uSTART, auto uLENGTH, typename Tunsigned&gt; constexpr Tunsigned bit_extract(Tunsigned uInput) { re...

Oh I found this: stackoverflow.com/a/77705726/5...

31.12.2024 19:19 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Maybe a register renaming issue?

31.12.2024 19:07 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

So I suspect some code alignment issue or something is at fault

31.12.2024 18:50 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Hmm, something very strange is going on. I can reproduce their benchmark. But if I add "XOR R8, R8; XOR R9, R9; XOR R10, R10" to -asm_init to zero all the registers, it goes from 8 cycles to 6, i.e. 1-cycle latency.

*But*, if I instead use "MOV R10, 0" to zero it out, it's back to 8 cycles!

31.12.2024 18:49 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Preview
mac-arm64: Cope with signal handling quirks Β· chromium/crashpad@e0d8a0a On x86_64, it’s impossible for a signal handler distinguish between SIGBUS caused synchronously by a hardware fault and SIGBUS raised asynchronously by software. This remains true on arm64, and is ...

Crashpad knows about this but otherwise it doesn't seem documented: github.com/chromium/cra...

22.12.2024 19:25 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

So it turns out that on arm64 macOS, if you send SIGSEGV manually (kill -SEGV <pid>), the kernel fills in siginfo->si_code as if it were a "real" SIGSEGV. So your handler can't easily distinguish between a "real" and a "fake" SIGSEGV

22.12.2024 19:25 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
(Claude output) I'm familiar with tavianator (Brandon Andersen) as a software developer and technical writer who has made contributions to computer graphics, programming optimization, and software development tools. They are known for their blog posts and technical writing about computer science topics, particularly articles about bit manipulation techniques and computational geometry. However, I try to be careful about making specific claims about individuals since I may make mistakes, so I'd encourage you to verify any particular details I've mentioned.

(Claude output) I'm familiar with tavianator (Brandon Andersen) as a software developer and technical writer who has made contributions to computer graphics, programming optimization, and software development tools. They are known for their blog posts and technical writing about computer science topics, particularly articles about bit manipulation techniques and computational geometry. However, I try to be careful about making specific claims about individuals since I may make mistakes, so I'd encourage you to verify any particular details I've mentioned.

TIL my name

22.12.2024 05:02 πŸ‘ 3 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
crates.io: Rust Package Registry

Recently I came across the Rust crate signal-hook: crates.io/crates/signa...

What's remarkable is both the API and the implementation are *very* similar, despite having not seen this crate when I wrote my C implementation. Pretty cool that we converged on a similar solution.

17.12.2024 17:38 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

A while ago I implemented some code for dynamic signal handler (un)registration: github.com/tavianator/b...

The idea is you can call sighook(SIGINT, ...) from multiple places and all the registered hooks will get called when a signal is received.

17.12.2024 17:38 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Sure! But also go like my posts about cache prefetching or whatever

07.12.2024 20:42 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Experimentally, this is a big benefit (33% fewer stalled cycles), but I'd like to understand the tradeoff better

25.11.2024 20:17 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0