RSS Amplifier

Blog

Sayan Sivakumaran's Blog

I like writing about the nitty gritty technical details of accessibility.

sayansivakumaran.comRSS feed ↗12 posts

Latest posts

Performance Experiments are Hard

Running good experiments is obviously hard. This is exemplified by the numerous resources you can find online about the reproducibility crisis in various scientific fields. Naturally, running performance experiments in computer science is also hard, and it is too easy to misinterpret the results or to present data which hides the complete story. I found it interesting how multiple fields of…

Observing network interface statistics with iproute2

I am a big fan of tools that lets you observe the behavior of low level systems, as it is great for learning. For example, hardware performance counters are great for observing processor behavior that is otherwise transparent for the developer. Similarly, the herdtools7 suite is great for observing the behavior of your processor's memory model. I've been running a networking book club at my…

A Brief Look at the Mathematics of Structure Packing

It's common knowledge that the memory layout of a structure in C can change depending on the order its members were declared in. For example, on my x86-64 processor, sizeof(Foo) is not equal to sizeof(Bar) , even though they effectively have the same members. You can try it out yourself on Godbolt . struct Foo { char firstChar ; double firstDouble ; char secondChar ; } ; struct Bar { double…

Plotting the distribution of floating point numbers

There is an interesting post from 2010 that plotted the distribution of a custom 6-bit floating point format. I was curious what the resulting graph would look like if we plotted IEEE single precision floating point numbers, instead. Luckily, this turns out to be very easy using the gnuplot utility! The trick is to use the nextafterf (manpage) function to create an enumeration of the floating…

RIP relative addressing in x86-64

I was attempting to learn about how dynamic linking worked in Unix systems, and along the way I encountered the concept of the GOT (Global Offset Table) and PLT (Procedural Linkage Table). I wanted to see these concepts in action for myself, so I decided to compile a very simple 'Hello World' C program and debug its assembly: # include <stdio.h> int main ( void ) { printf ( "Hello World" ) ; } If…

Configuring YCM to allow the restrict keyword in header files

When doing some C development earlier today, I noticed I was getting a very particular error in vim. Given a simple header file like this: struct Foo { int * restrict ptr ; } ; YCM would give an error saying [expected_semi_decl_list] Line 2: expected ';' at end of declaration list , even though this is perfectly valid C. The reason this happened is because my configuration of YCM was using clangd…

Inspecting LLVM inlining decisions with LLVM logging

I was curious about how LLVM makes decisions on whether to inline a function or not, and wanted to get a high level overview of its strategy. Thankfully, it seems like there is some relevant logging in InlineCost.cpp that we can take advantage of! All we have to do is compile Clang in debug mode, then invoke clang with the arguments -mllvm -debug . All this does is pass the -debug flag to the llvm…

Storage of Compound Literals in C

Some subtle details about compound literals confused me while going through Modern C . For example, what do you think will be returned if we compile and run the following code? struct foo { int i ; } ; int main ( void ) { struct foo * p = 0 , * q ; int j ; for ( j = 0 ; j < 2 ; j ++ ) q = p , p = & ( ( struct foo ) { j } ) ; return p == q ; } If you read the code, you might assume that this will…

Experimenting with AMD64 Alignment Checks

While going through the Modern C book, the author mentioned a very cool blog post by Ygdrasil that showed how to enable alignment checks for Intel x86 processors . I've heard in some casual conversations that data alignment is largely not relevant for Intel and AMD processors anymore, although I don't have the personal experience or expertise to verify the truth of that! However, naively running…

What exactly is the accessibility API?

This blog post duplicates my talk "What exactly is the accessibility API?" at Devfest Wisconsin , except with technical detail and comments that I opted to leave out of the presentation. Here are the slides if you really want them, though. I notice that a lot of content introducing the accessibility API ( Application Programming Interface ) only talk about how it might be used by screen readers.…

On anxiety and becoming a better software engineer

FYI, this is a somewhat unintelligible stream of thoughts that have been bothering me over the past year. I've recently been thinking a lot about whether I am a "good" or "bad" developer, to the point where it was probably a bit unhealthy. Ever since I started contributing to open source and doing things that are traditionally associated with "hacker culture", I've started to realize how much…

Exploring the "Is this a real or fake table?" algorithm in desktop browsers

There are a lot of websites out there that, unfortunately, use the <table> HTML element as a styling tool. This poses a problem to users of assistive technology, as there is now a lot of incorrect semantic information in the page. To mitigate this issue when creating the accessibility tree, browsers try to guess when a <table> is being used for purely styling purposes. If they guess that a <table>…