And so, the long weekend slowly comes to a close, and work will begin anew in a few short hours.
Over the weekend, I played with the King's Flute Choir at the Flutes in the Forest concert on 2026-11-07T19:30+08, held at Esplanade Recital Studio on The Big Flute. It was a magical performance---unlike the first time that I played there (and with the KFC), there was definitely less stiffness as I have known these folks a little more, and the repertoire was definitely better felt than before, and all in all, I had a wonderful time.
There were also more folks whom I know who bought tickets to come watch the concert, and they spanned from work, to church, and even to TGCO, though how many from the last group was very uncertain, what with many taking opportunity of the ``natural'' long weekend that came from an extra off-day due to Deepavali being on a Sunday to head out of country.
On Sunday, I made my way to the Autumn Flute Festival held at SOTA Gallery by MusicGear and Band World friends. It's an almost annual event where exhibitors from around the region swing by with their flutes, piccolos, and related accessories to show off the latest gear that is available for flute folk, while Muramatsu, Miyazawa, and Sankyo flute technicians do light servicing for the flutes in the background. It's a format that has been happening for at least ten years now, and I have made several friends among the exhibitors. The AFF usually runs for two days, and I'm almost always there for both days, but this time round, I could only go for the second because of the KFC performance on the first. One good thing that came out of that was that the exhibitors were also present at the performance itself, which gave some cool ice-breaking conversations for the new folks whom I've not met before---I was pretty hard to miss, considering that I played The Big Flute, while also having a bald crown.
Anyway, one of the more interesting things that happened during the AFF was from Churaoto Kobo Josef Co., Ltd. Their CEO, Mr Yukio Nakamura, was present (with his wife, I think), and when I was trying out their DARAUMA headjoint (it looks like a traditional cut headjoint, but with an additional channel carved after the blowing edge to allow the air stream to cut much deeper without dealing with the traditional mass of the wall in the way---think of how the Pneumo Pro looks like for a better visualisation) on the hibari Series piccolo, he made a comment that I was a very good player---because I was playing stupid high notes very softly, and with super clean staccato, the kind of playing that I would normally do on a bangdi or even a xiaodi. It was quite pleasant to hear that comment from him---I think this was probably among the first times that Josef has had a presence at the AFF. Maybe they will come again. Oh, and I shared with them about the ``Oval-8'' rings that I was using to prevent my pinkies from locking up.
The other interesting thing was also associated with Josef---their piccolo cleaning flags were at least 1.5 inches longer than the standard Valentino piccolo cleaning flag(!). This means that with that, I could easily swab out Stella (Nagahara MINI) without having to disassemble her!
But they didn't sell it loose like that, and I am now seriously considering having a longer screw-on handle rod machined. It has gotten to the point that I am staring pretty intently at Mitutoyo's fastener tread gauges to figure out the tapping needed.
I met Mr Guo (GUO Music Instrument Company) once more, and he was showing me his prototype PHONIC crown for the contrabass flute. It looked really cool, but I didn't bring The Big Flute down during my trip to AFF because I was just tired and wanted to just enjoy the fair without lugging too much luggage. It can be a really good upgrade to The Big Flute to enhance articulation through damping out the excess noise/standing waves after the motive force (i.e. the airstream) is removed.
I then went on to have dinner at Five Guys, walking from SOTA Gallery to Plaza Singapura, only to walk back to SOTA to take the bus back home.
And as for today, I just slept in, and spent much of the day catching up on my various YouTube videos, before deciding to write this entry.
That's one of two major flute performances done. The next one will be with AFE JB, and on 2026-11-29... which leaves something like another three-ish weeks left for rehearsals. And then, that's probably the last of the performances for this year, unless I get directly involved in this year's Christmas event under Music Ministry (hard to say at this point).
Sadly, I am having a weird-ass tension headache on my left side, so I'm just going to call it a day for all major activities, and just turn in for the night.
Till the next update, I suppose.
An eclectic mix of thoughts and views on life both in meat-space and in cyber-space, focusing more on the informal observational/inspirational aspect than academic rigour.
Monday, November 09, 2026
Sunday, November 01, 2026
counter_game Has Been Released Upon the Unsuspecting World!
Today, I bring you:
The premise is simple: increment a 64-bit unsigned integer counter, one at a time.
And that's it.
It's fun because it is hilariously straightforward in terms of what it seeks to do. No funny multipliers, no annoying precision-loss when double-precision floating point numbers are inevitably used (staring at you, Cookie Clicker). Just good old fashioned incrementing of an integer variable.
What's really interesting are two things.
The first, is that modern CPUs are scary fast, even without taking into consideration that there are multiple cores per CPU. On a thermally limited machine that is Eileen-III, I am consistently seeing 5e+09-ish increments per second, while on a machine that does not have that limitation (i.e. running in an air-conditioned room), I had seen 7.4e+09 increments per second.
That's actually more than the burst clock speed of 5.5 GHz to 6.1 GHz that is common these days.
And yet, it still takes decades to truly rollover all 264 different values of the counter.
The second, is the iterations that I had went through to fixing the code up. The original code was written a few months ago, and its requirements were more or less the same as what I had released---increment a large unsigned integer counter in as tight a loop as possible, but have a means of keeping track of the work to resume later on somehow. And maybe have some simple output that is user-triggered to avoid the penalty of doing I/O for something that is ``obviously'' CPU bound.
Oh, and avoid the compiler from optimising away the ``obviously'' do-nothing increment loop.
I started with C99, and wrote something very similar to what I currently have, with the following major differences:
What happened?
Well, I chucked it into GPT-6 to see what the LLM could suggest as code improvements, and through to and fro, managed to converge to the current released version.
The only thing that wasn't really suggested by the LLM was the removal of that
For the confused,
That change dramatically sped up the increment rate by more than 10-fold, since each increment no longer needed to go through the entire memory hierarchy of L*-caches before reaching RAM.
So with my foray into using LLM for support in software programming, what do I feel? Honestly, it isn't too bad, but to be fair, this is merely about improving an existing program that does something pretty simple---it is not a multi-file project with the full backing documentation of user requirements, project specifications, and everything else under the sun.
As a tool, it is fine for this case, but in some future post, I might talk about another different programming project that I had GPT-6 assist me. Spoiler: that one was a doozy, even though the outcome is still better than what I would do myself.
The key thing to take away is that using these tools really does make me lazier in some ways, and more hardworking in others. Yes, I wouldn't set out to write my own custom C99-compliant code to output the large integers in groups of six digits due to how annoying it was, but with the LLM yelling at me often enough about ``hur hur you claim C99 compliance but you're using GNU extensions you dumbass'' was enough to start the skeleton of that code, and have the GPT-6 finish it up.
``MT, what's the purpose of
It's an idle game where a counter is diligently incremented one at a time by the CPU without funny modifiers, exponentiation shenanigans, and bad floating point numbers. That's its purpose. It can also act as a low-resource single-thread (not core since I do not put in non-C99-compliant CPU affinity setting code) performance tester for a computer that runs Cygwin/Linux, at least on the dimension of incrementing a register.
I think that's as pithy a response as I have.
Till the next update.
counter_game, the most simplified of idle games that I can come up with that is still somewhat meaningful.The premise is simple: increment a 64-bit unsigned integer counter, one at a time.
And that's it.
It's fun because it is hilariously straightforward in terms of what it seeks to do. No funny multipliers, no annoying precision-loss when double-precision floating point numbers are inevitably used (staring at you, Cookie Clicker). Just good old fashioned incrementing of an integer variable.
What's really interesting are two things.
The first, is that modern CPUs are scary fast, even without taking into consideration that there are multiple cores per CPU. On a thermally limited machine that is Eileen-III, I am consistently seeing 5e+09-ish increments per second, while on a machine that does not have that limitation (i.e. running in an air-conditioned room), I had seen 7.4e+09 increments per second.
That's actually more than the burst clock speed of 5.5 GHz to 6.1 GHz that is common these days.
And yet, it still takes decades to truly rollover all 264 different values of the counter.
The second, is the iterations that I had went through to fixing the code up. The original code was written a few months ago, and its requirements were more or less the same as what I had released---increment a large unsigned integer counter in as tight a loop as possible, but have a means of keeping track of the work to resume later on somehow. And maybe have some simple output that is user-triggered to avoid the penalty of doing I/O for something that is ``obviously'' CPU bound.
Oh, and avoid the compiler from optimising away the ``obviously'' do-nothing increment loop.
I started with C99, and wrote something very similar to what I currently have, with the following major differences:
- The counter was originally of type
static volatile uint64_t, which was because... - ...the original signal handler was doing the actual saving of state, which meant that
volatilewas needed to tell the compiler to not optimise away what is effectively a ``do-nothing tight loop'' to the compiler; and - I had to resort to some GCC extension of
localeto enable thousands separators for the ludicrously large integers because I was too lazy to write my own C99-compliant version.
What happened?
Well, I chucked it into GPT-6 to see what the LLM could suggest as code improvements, and through to and fro, managed to converge to the current released version.
The only thing that wasn't really suggested by the LLM was the removal of that
volatile specifier---with the signal handler only setting some atomic signal outside of the tight loop, and the logic for the I/O pushed into the tight loop but guarded by a signal comparison, the volatile storage class was no longer needed since the counter variable was in scope for both increment, and reference for the purposes of doing I/O.For the confused,
volatile tells the C99-compiler that a particular variable should be assumed to be backed by memory, which means that when optimising/generating code, the register-only optimisation is not allowed; all references to the volatile variable must load the value from the memory, and subsequently written back, without assuming/keeping the value based on what is in the register.That change dramatically sped up the increment rate by more than 10-fold, since each increment no longer needed to go through the entire memory hierarchy of L*-caches before reaching RAM.
So with my foray into using LLM for support in software programming, what do I feel? Honestly, it isn't too bad, but to be fair, this is merely about improving an existing program that does something pretty simple---it is not a multi-file project with the full backing documentation of user requirements, project specifications, and everything else under the sun.
As a tool, it is fine for this case, but in some future post, I might talk about another different programming project that I had GPT-6 assist me. Spoiler: that one was a doozy, even though the outcome is still better than what I would do myself.
The key thing to take away is that using these tools really does make me lazier in some ways, and more hardworking in others. Yes, I wouldn't set out to write my own custom C99-compliant code to output the large integers in groups of six digits due to how annoying it was, but with the LLM yelling at me often enough about ``hur hur you claim C99 compliance but you're using GNU extensions you dumbass'' was enough to start the skeleton of that code, and have the GPT-6 finish it up.
``MT, what's the purpose of
counter_game then?''It's an idle game where a counter is diligently incremented one at a time by the CPU without funny modifiers, exponentiation shenanigans, and bad floating point numbers. That's its purpose. It can also act as a low-resource single-thread (not core since I do not put in non-C99-compliant CPU affinity setting code) performance tester for a computer that runs Cygwin/Linux, at least on the dimension of incrementing a register.
I think that's as pithy a response as I have.
Till the next update.
Subscribe to:
Posts (Atom)