today I have mostly been asleep

Jun. 17th, 2025 11:47 pm
kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)
[personal profile] kaberett

The watch tells me I achieved +102 "body battery" points, which I am amused to see.

But I have also visited the allotment (on my way back from physio) and have eaten: raspberries, a strawberry, a cherry, redcurrants, jostaberries, peas, broad beans, kohlrabi. V pleased.

vital functions survived an event

Jun. 15th, 2025 11:59 pm
kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)
[personal profile] kaberett

... and has been doing very little of anything else. SHOCKINGLY.

Listening Post: some things

Jun. 15th, 2025 07:59 pm
highlyeccentric: Divide by cucumber error: reinstall universe and reboot (Divide by cucumber)
[personal profile] highlyeccentric
Today's musical development is that courtesy of the world's least impressive dictactor parade, I have remembered that I actually like Credence Clearwater Revival. Figured out that the cassette tape we used to have in the car must have been Cosmo's Factory with a couple of tracks off Willy and the Poor Boys taped onto the end.

Instagram has been feeding me a trickle of interesting indie protest-song creators lately.

Consider Jesse Welles, who seems to be able to come up with a new political song within a day of every new twist the Trump administration disaster show. I do somewhat prefer his less "breaking news" work, for instance:



There's Malört & Savior, who have this rather catchy little track. Although what really strikes me is that they seem to be a fairly new band, and cerainly this was put out in the past month - but they SOUND like they walked straight out of 2009.



And there's Rain McMey, who has a few bangers going back a few years now, but this one delights me:



Podcasts, assorted recommendations:

  • The recent Bad Gays episode about Gavin Arthur was pretty fascinating.
  • I enjoy "Lions Led By Donkeys" frequently, and they had a thematically linked pair of interesting episodes recently: The Pastry War (also known as the first French Intervention in Mexico) and The War of the Oaken Bucket.
  • The most recent episode of Gender Reveal, with Alison Bechdel is great, generally, and has particularly interesting comments on the difference between memoir and fiction.
  • The Odd Lots podcast episode of last week, A Major American Egg Producer Just Lost 90% of its flock was fascinating. It's sort of a follow-up to Why are Eggs So Expensive of last year, which I also really appreciated (dangerous though: the cashier at my local service station convenience store wasn't expecting a mini-lecture on how long it takes to recover from a bird flu outbreak, or the impact which the fade-out of battery farms has). This time I was also particularly struck by the way Hickman talked about not being able to access vaccines - apparently the US exports vaccines to other countries who choose to vaccinate their laying flock, but US producers who WANT the vaccine can't get hands on it. He did not once mention the post-covid stakes in anti-vaccination policy, but you can kind of hear the outlines of it as he's talking. The other thing that was really clear is what an impact bird flu must have on the local economy - when Hickman's talking about the cost to the company of losing "institutional knowledge" and/or having to "hire back" the staff once the flock is re-established, that must mean that an outbreak means massive job losses.
  • The Behind the Bastards two-parter about Versailles was fascinating in its own right. I also, courtesy of a reminder somewhere in there that this is NOT a medieval system of administration, and courtesy of my own having figured out that the HSC modern history syllabus, which started "modernity" with the French revolution and absolutely did refer to the preceding regime as medieval, wasn't just lying-to-children, it was specifically drawing on the long duree, Marxist-leaning school of historical analysis - well put those two together and... oh, RIGHT. The reason the "palace complex" of Tamora Pierce's Tortall (or Mercedes Lackey's Valdemar) is so _bizarre_, economically speaking, is that their shared invisible template is _Versailles_. Combined with the 16th c English Chancery, certainly, and some influence from the Prussian War College.


  • Fiction:
  • I powered through Dimension 20's "Fantasy High: The Seven" and I loved it. Adorable! Now on to Fantasty High: Junior Year, which I am actually finding a little difficult as the early episodes have so much emphasis on how busy / under pressure everyone is. And the "your god is at risk of dying, you are her only believer, why aren't you evangelising for her?" storyline re Kristen is... uncomfortable. Maybe it's cathartic to Ally Beardsley, but it makes me feel squeamy.
  • Because I require MORE of Brennan Lee Mulligan in my ears, I found Worlds Beyond Number and am so far enjoying The Wizard, The Witch and the Wild One.
  • siderea: (Default)
    [personal profile] siderea
    I have a question about eye safety, maybe someone here can advise me on.

    Apropos of the protests going on, I've seen a lot of helpful pointers about preparing for getting tear gassed or pepper sprayed, such as not to wear contacts and to have tight-fitting chemists' goggles. But not wearing vision correction is not an option for those who need it, and the alternative to contacts is glasses, which are apparently incompatible with most eye protection from gas or particulates.

    I am aware of the existence of some models of full-face gas mask that have internal mounting hardware for glasses, but in addition to being expensive themselves, they require getting lenses made and fitted to the gas mask (i.e. not compatible with regular glasses). I'm surmising the existence of these means that other, cheaper, spectacle-compatible eye protection doesn't really exist, but I thought I'd ask.

    My personal interest in the topic is less about protecting myself from chemical ordnance at protests – I only wish I could attend protests (though if things got spicy in the right location I suppose I could collect my fair share of tear gas at home) – than from wildfire smoke. The conjunction of the No Kings protests and the local air quality alerts from fires in Canada reminded me I should really be doing some preparation in this space.

    I'm allergic to smoke. (It turns out it wasn't con crud I kept getting at Pennsic.) My reactivity to smoke only seems to be gradually getting worse over time. So when I've heard reports or seen pictures from the left coast of the sorts of wildfire smog they have there, I'm like "...not enough steroids in the world." I mostly manage this threat by not crossing the Mississippi, but it could happen here. Or upwind of here. It has. If not quite so "blot out the sun" bad, certainly bad enough for me to feel it.

    So I've been looking at half-face elastomeric respirators, but that leave eyes unprotected.

    Any suggestions?

    Edit: I'm getting a lot of suggestions that aren't really helpful because:

    1) Most safety goggles are for protection against impact or splashes, and as such literally have vent holes that make them useless against gases and airborne particulates.

    2) Involve buying a prescription eyepiece. The whole point of my question was looking for alternatives to buying additional prescription lenses. Like I said, I am already aware of options that entail ordering custom lenses, I am looking for alternatives that don't involve that and are compatible with regular glasses the wearer already has.

    There may not be any*, which would be good to know, but that is the question.

    Allow me to put a finer point on this. If there is no affordable, readily available option for eye protection against gas/powder attacks for people who are dependent on vision correction, then that implies something important about protest safety that is entirely missing from all of the discourse of the sort that recommends having a gas mask to go to a protest.

    * Since posting, I learned the term PAPR, and am now wondering why they're so expensive and whether that's a technology ripe for DIY.

    two some good things

    Jun. 14th, 2025 11:59 pm
    kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)
    [personal profile] kaberett

    Item the first: I have no idea what the hell made the ominous donk-slither-donk noise in the portaloo at about midnight last night, but the phone I'd convinced myself it was was in a neat little pile with my laptop, in the tent, in the morning -- after I'd spent some time being sad about inadequate backups of photos of tiny sleepy rhinos -- which was an enormous relief (though I am also very pleased with myself for how well I handled things). (Especially given that my conviction that this was what had happened was in part based on being as aware as I could be of how abruptly my cognitive function had deteriorated with Surprise Unscheduled Migraine Onset.) (Still haven't worked out what on earth the donk-slither-donk was, but it's none of the obvious Truly Upsetting things to have lost, so I'm Currently Fine With This.)

    Item the second: it is hot. This field contains lots of chamomile, and also lots of people. I am really enjoying the way it smells.

    Item the third: I am really enjoying the dark chocolate + salt + nuts snack bars that crew welfare is providing, which I'd not previously noticed.

    Item four: THE HALBARD THAT IS A SHARK.

    In (near) Prague

    Jun. 14th, 2025 08:18 am
    rmc28: Rachel in hockey gear on the frozen fen at Upware, near Cambridge (Default)
    [personal profile] rmc28

    On an ice hockey camp in Slaný, near Prague. I flew out on Thursday afternoon with two friends from Kodiaks. We arrived at the rink hotel in time to check in, have a little walk down to the nearby supermarket and get food, and settle in for the night. For reasons the three of us were all sharing a dormitory room the first night, and we decided the perfect film to watch over our picnic dinner was Inside Out 2 - also set at a 3-day hockey camp. I hadn't seen it before, though the other two had, and I enjoyed it very much.

    Friday morning was pretty relaxed; a fourth Kodiak joined us after leaving home at awful-o-clock in the morning, and we were moved into the nicer ensuite twin rooms in pairs for the rest of the camp. We met in the dressing room at 1pm, were on ice at 2pm and again at 6pm, with a stickhandling session in between. Then dinner at 8 and falling into bed not long after.

    It's excellent coaching, I'm being pushed well out of my comfort zone and the balance of drill and rest in each session and between sessions is just right. I hit my "cannot actually skate any more" limit about 3 minutes before the end of the last ice session.

    Today will be two ice sessions at either end of the day, with video review (argh), optional swim+spa (yes!), and stickhandling again in between. My muscles this morning are making themselves known but I'm not exhausted. All is good. Time to go get changed.

    [fieldposting] day 0 complete

    Jun. 12th, 2025 11:53 pm
    kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)
    [personal profile] kaberett

    I am already very very tired.

    But.

    In a magnificent example of Prosocial Mammals: yesterday, when we were like 3/4 of the way to site, I realised that I no longer had "migraine stabs" on my packing list because I had carefully arranged things so that stabs would be due on a Tuesday so I would never need to faff with stabs in a field again.

    ... which I completely forgot. Until. 3/4.

    ... so I put out a Wail addressed to Londoners who would be Heading To The Field, and one of them ACTUALLY WENT on the terrible multi-borough fetch quest to get me my stabs so I HAVE BEEN STABBED and was only one day late, not a week! which is probably going to make the next month much more pleasant! and I just. continue delighted about this.

    There you go that's your anecdote of the day.

    delight of the evening

    Jun. 11th, 2025 11:54 pm
    kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)
    [personal profile] kaberett

    Okay. So.

    Admin: the LRP has a variety of in-game resources. One of the more valuable ones is mithril, which gets used for all sorts of things, like armour and weaponry and building works, particularly military ones.

    This event we are seeing the launch of The Cow Stock Market. This inevitably was a topic of discussion over this evening's pizza: discussion of the designs of the I Promise To Pay The Bearer On Demand One (1) Cow slips! speculation over Cow Futures! debate over the impact on the gold mithril standard!

    It'll be fiiiiiiiiiine, says A. It'll all be TOTALLY fine. You can absolutely build fortifications out of cows!

    -- and at this point, for those of you who are abruptly cackling, I need to point out that A has not read Nona the Ninth.

    I also need to point out that I am in a specific groupchat, specifically set up following the event where someone managed to get their hands on some copies of Nona a few days before official release and there was consequently significant in-field bartering for who got to be next in the queue to inhale them, that is named after. well. the cows. did you know that cows have best friends.

    But A had no idea why I was abruptly losing it, and I decided that rather than attempt to explain I was in fact first of all going to Depart Our Table, find my Nona dealers, and relate unto them the story of The Thing A, All Unawares, Just Said.

    The reaction was extremely gratifying.

    kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)
    [personal profile] kaberett

    Two things:

    1. I keep (especially post-surgery, cotemporal with relearning how to walk) finding more small ways that how I've been doing my various physio exercises isn't quite right. This is a good thing! Isn't it fascinating to be learning more about embodiment and how my body works and how I can best deploy my various muscles!

    2. Up until the hypermobility clinic, all the physio I was ever prescribed made me worse, not better.

    It abruptly dawned on me, all at once, that the subtlety of the changes I'm making with adjusting how I'm shifting my weight around and so on and so forth? Are almost certainly not actually externally visible. Like, yes, people not understanding hypermobility and problems with it was also Definitely A Problem, but -- the part where I'm still, mm, not necessarily fixing things but certainly developing them, finding places where even with What The Hypermobility Clinic Told Me To Do I wasn't getting quite right... well, the hypermobility specialists clearly went "eh, good enough", and in terms of the effects on my ability to Things I think they were clearly demonstrably provable correct, but -- yeah, okay, sudden understanding of some of just how difficult it would have been to correct some of this stuff.

    (I'm very sure that all my various epiphanies will turn out to be about things that still aren't quite right, that I can still refine further -- I'm having an extended phase of that with Pilates right now -- but this is a good thing, actually. It's really nice to have such clear evidence that I'm getting to know and understand myself better.)

    fanf: (Default)
    [personal profile] fanf

    After I found some issues with my benchmark which invalidated my previous results, I have substantially revised my previous blog entry. There are two main differences:

    • A proper baseline revealed that my amd64 numbers were nonsense because I wasn’t fencing enough, and after tearing my hair out and eventually fixing that I found that the bithack conversion is one or two cycles faster.

    • A newer compiler can radically improve the multiply conversion on arm64 so it’s the same speed as the bithack conversion; I've added some source and assembly snippets to the blog post to highlight how nice arm64 is compared to amd64 for this task.

    To-read pile, 2025, May

    Jun. 9th, 2025 07:31 pm
    rmc28: (reading)
    [personal profile] rmc28

    Books on pre-order:

    1. Queen Demon (Rising World 2) by Martha Wells (7 Oct 2025)

    Books acquired in May:

    • and read:
      1. Copper Script by KJ Charles
      2. Red Boar's Baby by Lauren Esker
    • and unread:
      1. The Wrath & The Dawn by Renée Ahdieh [3]
      2. The Unexpected Inheritance of Inspector Chopra by Vaseem Khan [3]
      3. Kidnap on the California Comet by M.G. Leonard & Sam Sedgman [3]
      4. Betrayal (Trinity 1) by Fiona McIntosh [3]

    Borrowed books read in May:

    1. The Good Thieves by Katherine Rundell
    2. One Christmas Wish by Katherine Rundell
    3. You Have a Match by Emma Lord [2][6]

    I continue to not read much (by my standards). I did not manage to read any of the physical books I had out of the library until they needed to be returned, and I've got several half-finished books in progress. (Oh, and in writing this I've realised I already have the Renée Ahdieh book in ebook, and haven't read it there either!)

    [1] Pre-order
    [2] Audiobook
    [3] Physical book
    [4] Crowdfunding
    [5] Goodbye read
    [6] Cambridgeshire Reads/Listens
    [7] FaRoFeb / FaRoCation / Bookmas / HRBC
    [8] Prime Reading / Kindle Unlimited

    EHRC nonsense

    Jun. 9th, 2025 11:14 am
    lnr: Halloween 2023 (Default)
    [personal profile] lnr

    We still haven't met with Senior Management: it's now due tomorrow, in person. I'm gently trying not to panic.

    There's still been no message of support to all members of staff and students from the University, and nothing at all from the department. Though I understand they're still in discussions in the background. This is frustrating.

    The subject was raised at a recent All Staff meeting (in which people submit questions as text, and senior management attempt to answer them). We were given broad assurances that the university values and supports trans people, but nothing actually useful or genuinely supportive was said.

    In the meantime a new EHRC chair is due to be appointed, and they're considering a person with a known anti-trans background. There's an Open Letter available to sign in protest, written by a very good friend and colleague: https://docs.google.com/forms/d/e/1FAIpQLSe_Y77t7CQqKjdGifNa0lE3HKjDAb1UoJdjuLAbInhIQsRMhw/viewform

    I've also seen a good template if you want to write directly: https://docs.google.com/document/d/1865KMfu24JgmwnWmYXaVc3jlzj5uQFEq69hXMxKP6BU/edit?tab=t.0

    And I wrote my own version:

    9th June 2025
    Dear Women’s and Equalities Select Committee and Joint Committee on Human Rights,
    Cc: Pippa Heylings, as my MP

    I am writing to express my grave concern about the proposed appointment of Dr Mary-Ann Stephenson as the Chair of the Equality and Human Rights Commission.

    I won't include a string of references here, because I think you will have seen them all already, but I think it is imperative that the next person appointed as Head of the EHRC should not be seen to have a strong anti-trans background. Trans people are currently scared. Scared for their jobs, if they cannot access their workplace in safety and dignity. Scared of being assaulted if they go to the "wrong" toilet. Scared of being outed as trans in public if they try to follow the new guidelines.

    And I am scared as a cis woman, a woman who is not trans, at what is happening in our country, and what this means for my friends and colleagues and for trans people in general. For intersex people, non-binary people, and any woman who might be mistaken for being trans. Other women need to feel safe too, but excluding trans people is not the way to do this.

    The EHRC needs to stand up for the rights of everyone, and to be seen to do so. I sincerely hope you will take this into account.

    Kind Regards,

    Eleanor Blair
    Great Shelford, Cambridge, CB22

    I'm not even going to attempt to get into the member of the EHRC who was quoted as effectively saying that trans people have been misled about their rights under the Equality Act for the last 15 years, and there will now be a period of adjustment, but they should just get used to having fewer rights than they thought they did. The Guardian changed their headline and reporting three times as a result of her protesting about being misquoted, but that seems to have been the gist of it. Not mentioning that the "misleading" guidance came from the EHRC themselves, and was based on the previous understanding of the Equalities Act and entirely consistent with it. FFS

    kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)
    [personal profile] kaberett

    Reading. FINISHED:

    • Furiously Happy, Jenny Lawson. I can see why people like her! I have also remembered why I wound up unsubscribing from her blog. Very interesting proof of concept in re audiobooks, though.
    • Prophet, Helen MacDonald and Sin Blaché. Very enjoyable reread in which many things landed differently, in service of...
    • a word you've never understood, [personal profile] rydra_wong. EXACTLY the post-canon follow-up I wanted but would have absolutely failed to articulate. Have already tried to lure one more person into reading the book so I can then make them go read the fic. Now I just selfishly want Even More Of It.
    • Pain is really strange, Steve Haines. Reread for the purpose of making notes, this time. Sparked at least one useful thought. Following up references is a work in progress.
    • How to cook... Desserts, Leiths Cookery School. Read all the way through for the purposes of EYB indexing first pass! Go me.

    STARTED:

    • Adventures in Stationery, James Ward. Borrowed from library on a whim for low-brain non-fiction.

    Writing. First pass through indexing a cookbook on EYB!

    Some Actual Notes re pain for The Book, including (and I am very proud of myself for this) actually writing down my questions alongside the bare "here's what it contained".

    Watching. Murderbot S01E01. I am dubious but expecting to keep watching. If you encourage me I might say more when it is not past curfew.

    Cooking. ... apparently I have not managed Much Of Note this week.

    Eating. POTATOES at the ALLOTMENT courtesy of ALLOTMENT FRIENDS. Also finished my choi sum and had my first AMAZING broad beans and nibbled kohlrabi speculatively, all on Tuesday.

    Today I have nibbled: a cherry; the first few redcurrants; a pod's worth of Kelvedon Wonder peas; half a tiny tomato.

    Making & mending. Made some progress on A's left glove. Realised, belatedly, that I'd done the same thing with picking up stitches unevenly along the two sides of the palm. Ripped back most of the way to where I started from and Sulked. BUT HEY I've remembered the pattern and where I'd stowed all the bits for it!

    Growing. See Eating for my biggest excitements. Sugar Magnolia (purple sugar-snap pea) now setting pods; my main intention with it this year (given that I planted a whole packet of seeds and have wound up with ...fewer plants than that) is just to get myself sorted with a significantly larger number of seeds for next year, but hey, maybe they'll all be super productive and I'll actually get to eat some too.

    Stockings now at the plot to go onto the cherry tomorrow, hopefully.

    Tomatoes planted out when tiny not doing so great (i.e. have mostly disappeared). Tomatoes planted out when larger Actually Flowering. Desperately need to stake the lot of them.

    Tiny single solitary surviving oca has started to Go.

    V grumpy about how poorly the squash I got started A While Ago have coped with getting put outside given that they are in biodegradable fibre pots so I'm not even disturbing their roots. Getting the rest of them in the ground AND THEN SOWING MORE very much also high on tomorrow's priority list. (And the beans, augh.)

    Observing. Met a neighbour!

    siderea: (Default)
    [personal profile] siderea
    2025 Jun 7 11:40 am: [profile] benjalvarez1 on Twitter:

    WATCH THIS: https://x.com/BenjAlvarez1/status/1931375699786334704

    Click through to see the video. You really, really should. Sound is irrelevant.

    Text: "Tanks, fighting vehicles and howitzers arrive in Washington, D.C. ahead of next week's military parade. They departed from Texas on June 2." Two minutes and forty seconds.

    Allegedly that train is a mile long and is transporting:

    • 28 Abrams tanks (M1A2 main battle tank)
    • 3 armored recovery vehicles (M88)
    • 28 Bradleys (M2A3 infantry fighting vehicle)
    • 5 Paladins (M109A7 self-propelled howitzer), and
    • 28 Strykers (infantry carrier vehicle)

    Source: 2025 Jun 6: @USAMilitaryChannel on YT [not official military channel]: "1-Mile Military Train -Texas to D.C. with Tanks, Armor, and More for Army's 250th Parade". I do not know if that source is reputable or if that inventory is accurate.

    USA Today is reporting that "The military vehicles will be joined by 1,800 soldiers". (Source: 2025 Jun 6, USATODAY on YT: "Watch: Tanks, fighting vehicles head to DC for Trump's military parade", CW: face full of Trump, alt: screenshot).

    I dunno, maybe it's just me, but I'm thinking that maybe the guy who attempted one coup already bringing a well-armed military force into our capitol city and, crucially, within artillery-range of the Pentagon, is just throwing himself a birthday party, but also maybe not.

    ETA: For those of you confused by this, thinking, but doesn't he already control the military? You might want to watch this video about the rise of Xi Jinping.

    Now, obviously, Trump would never play a long game like Xi did. But, 1) there are other ways to achieve the same end and 2) he doesn't have to, because his buddies, the Dominionists, did.

    performance of random floats

    Jun. 8th, 2025 03:15 am
    fanf: (Default)
    [personal profile] fanf

    https://dotat.at/@/2025-06-08-floats.html

    A couple of years ago I wrote about random floating point numbers. In that article I was mainly concerned about how neat the code is, and I didn't pay attention to its performance.

    Recently, a comment from Oliver Hunt and a blog post from Alisa Sireneva prompted me to wonder if I made an unwarranted assumption. So I wrote a little benchmark, which you can find in pcg-dxsm.git.

    (Note 2025-06-09: I've edited this post substantially after discovering some problems with the results.)

    recap

    Briefly, there are two basic ways to convert a random integer to a floating point number between 0.0 and 1.0:

    • Use bit fiddling to construct an integer whose format matches a float between 1.0 and 2.0; this is the same span as the result but with a simpler exponent. Bitcast the integer to a float and subtract 1.0 to get the result.

    • Shift the integer down to the same range as the mantissa, convert to float, then multiply by a scaling factor that reduces it to the desired range. This produces one more bit of randomness than the bithacking conversion.

    (There are other less basic ways.)

    code

    The double precision code for the two kinds of conversion is below. (Single precision is very similar so I'll leave it out.)

    It's mostly as I expect, but there are a couple of ARM instructions that surprised me.

    bithack

    The bithack function looks like:

    double bithack52(uint64_t u) {
        u = ((uint64_t)(1023) << 52) | (u >> 12);
        return(bitcast(double, u) - 1.0);
    }
    

    It translates fairly directly to amd64 like this:

    bithack52:
        shr     rdi, 12
        movabs  rax, 0x3ff0000000000000
        or      rax, rdi
        movq    xmm0, rax
        addsd   xmm0, qword ptr [rip + .number]
        ret
    .number:
        .quad   0xbff0000000000000
    

    On arm64 the shift-and-or becomes one bfxil instruction (which is a kind of bitfield move), and the constant -1.0 is encoded more briefly. Very neat!

    bithack52:
        mov     x8, #0x3ff0000000000000
        fmov    d0, #-1.00000000
        bfxil   x8, x0, #12, #52
        fmov    d1, x8
        fadd    d0, d1, d0
        ret
    

    multiply

    The shift-convert-multiply function looks like this:

    double multiply53(uint64_t u) {
        return ((double)(u >> 11) * 0x1.0p-53);
    }
    

    It translates directly to amd64 like this:

    multiply53:
        shr       rdi, 11
        cvtsi2sd  xmm0, rdi
        mulsd     xmm0, qword ptr [rip + .number]
        ret
    .number:
        .quad     0x3ca0000000000000
    

    GCC and earlier versions of Clang produce the following arm64 code, which is similar though it requires more faff to get the constant into the right register.

    multiply53:
        lsr     x8, x0, #11
        mov     x9, #0x3ca0000000000000
        ucvtf   d0, x8
        fmov    d1, x9
        fmul    d0, d0, d1
        ret
    

    Recent versions of Clang produce this astonishingly brief two instruction translation: apparently you can convert fixed-point to floating point in one instruction, which gives us the power of two scale factor for free!

    multiply53:
        lsr     x8, x0, #11
        ucvtf   d0, x8, #53
        ret
    

    benchmark

    My benchmark has 2 x 2 x 2 tests:

    • bithacking vs multiplying

    • 32 bit vs 64 bit

    • sequential integers vs random integers

    I ran the benchmark on my Apple M1 Pro and my AMD Ryzen 7950X.

    These functions are very small and work entirely in registers so it has been tricky to measure them properly.

    To prevent the compiler from inlining and optimizing the benchmark loop to nothing, the functions are compiled in a separate translation unit from the test harness. This is not enough to get plausible measurements because the CPU overlaps successive iterations of the loop, so we also use fence instructions.

    On arm64, a single ISB (instruction stream barrier) in the loop is enough to get reasonable measurements.

    I have not found an equivalent of ISB on amd64, so I'm using MFENCE. It isn't effective unless I pass the argument and return values via pointers (because it's a memory fence) and place MFENCE instructions just before reading the argument and just after writing the result.

    results

    In the table below, the leftmost column is the number of random bits; "old" is arm64 with older clang, "arm" is newer clang, "amd" is gcc.

    The first line is a baseline do-nothing function, showing the overheads of the benchmark loop, function call, load argument, store return, and fences.

    The upper half measures sequential numbers, the bottom half is random numbers. The times are nanoseconds per operation.

             old    arm    amd
    
        00  21.44  21.41  21.42
    
        23  24.28  24.31  22.19
        24  25.24  24.31  22.94
        52  24.31  24.28  21.98
        53  25.32  24.35  22.25
    
        23  25.59  25.56  22.86
        24  26.55  25.55  23.03
        52  27.83  27.81  23.93
        53  28.57  27.84  25.01
    

    The times vary a little from run to run but the difference in speed of the various loops is reasonably consistent.

    The numbers on arm64 are reasonably plausible. The most notable thing is that the "old" multiply conversion is about 3 or 4 clock cycles slower, but with a newer compiler that can eliminate the multiply, it's the same speed as the bithacking conversion.

    On amd64 the multiply conversion is about 1 or 2 clock cycles slower than the bithacking conversion.

    conclusion

    The folklore says that bithacking floats is faster than normal integer to float conversion, and my results generally agree with that, apart from on arm64 with a good compiler. It would be interesting to compare other CPUs to get a better idea of when the folklore is right or wrong -- or if any CPUs perform the other way round!

    some joys of the day

    Jun. 7th, 2025 11:57 pm
    kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)
    [personal profile] kaberett
    1. goslings! (Canadian; one still very yellow and fluffy, several more rather larger.)
    2. SNAILS. so many excellent snails. we went out on a couple of stupid little walks and saw MANY snails.
    3. ate the last of my birthday cake, with discounted raspberries courtesy of one of said stupid little walks. <3
    4. the post brought Several more books for me (two pain-related, ...some cookery) and I am very pleased with them. particularly looking forward to warm bread and honey cake, though given that I've still not actually read Salt Fat Acid Heat I don't rate my chances of getting to it any time soon...
    5. current borrowed-on-a-whim-from-the-library book: Adventures in Stationery, James Ward. First chapter was paperclips; current chapter is a whistlestop tour of The History Of The Pen, including a much more loving biography of the BIC Cristal than I am normally exposed to via fountain pen fandom!

    A mostly-free day

    Jun. 7th, 2025 10:31 am
    rmc28: Rachel post-game, slumped sideways in a chair eyes closed (tired)
    [personal profile] rmc28

    I'm playing an ice hockey game tonight in Cambridge, a charity fundraiser between Warbirds and Tri-Base Lightning. But until then I have a strangely unscheduled day. I might sleep or read or something.

    I could post about what I've been up to lately!

    Work:

    • spoke on a panel about effective 1:1s, it seemed to go well
    • played my usual Senior Tech Woman role for a colleague's recruitment panel, and am happy that our preferred candidate has apparently just accepted. (a frustrating number of timewasting applicants more or less obviously using LLMs to write their applications and generate their free-text statements on suitability for the role; I really resent having to wade through paragraphs of verbose buzzword bilge to ... fail to find any evidence they actually know how to do the job)

    Hockey:

    • KODIAKS WON PLAYOFFS on the bank holiday weekend oh yes they did. So proud of the players, and definitely earned my share of reflected glory managing the team this season and running around half the weekend. League winners, Cup winners, Playoff winners, promotion to Division 1 next season, utter delight.
    • Very much an Insufficient Sleep weekend, we topped off the playoff win with a night out in Sheffield, I got back to my hotel as the sky was getting light, good times.
    • Kodiaks awards evening last night: lots of celebration of the hard work and lovely camaraderie of this group of players, A and B teams both. I got to announce and hand out the B team awards, and I received a really nice pair of gifts for me as manager: a canvas print of a post-final winners photo, and a personalised insulated travel mug (club logo and MANAGER on it). I love this team.
    • I'm still enjoying also playing with Warbirds, and have now been to a few summer Friday scrimmages run by Tri-Base. I went to a couple of Friday scrims at the end of last summer and felt everyone was very kind but I was pretty outclassed. I'm pleased to feel like I'm keeping up a bit better now after training a lot harder this last season.
    • I trained three days in a row this week (Warbirds Monday, Haringey Greyhounds tryouts in Alexandra Palace on Tuesday, Kodiaks Wednesday) and that was Too Much and I was pretty sore Wednesday evening and Thursday. Rest days are important even if I am much improved in fitness compared to this time last year.

    Other:

    • I did a formal hall at my old College! Using my alumna rights and having a nice evening hanging out with old friends (who were the ones to suggest the plan). Good times, will do again but probably not this term.
    • I had an excessive number of books out from Suffolk libraries that needed returning, so I did a flying visit to Newmarket by bus last Saturday, this turned out to be the cheapest/quickest way across the county border. I managed to stick to my resolution not to borrow any more physical books but slipped and fell on the "withdrawn books for sale" stand. Managed to only come home with four.
    • I did a little indoor cricket the Friday before playoffs (it's now finished due to exam period), and some nets practice last Sunday, but I keep being too busy to actually play any of my team's games. I'd like to do more nets practice though, that was intense but also felt like I was beginning to improve.
    • I did a little table tennis with Active Staff but that's also now suspended for exams. I'm considering getting a cheap set of bats and balls for me and the family to go use at the local rec ground, or in the free indoor tables at the Grafton Centre.

    Coming up: my summer is full of ice hockey camps and tournaments (Prague, Hull, Sheffield, Biarritz) and my old club Streatham have just announced all their summer training sessions will be "Summer Skills Camps" open to all interested WNIHL players, so I'm looking at going to London regularly again in July and August.

    highlyeccentric: Demon's Covenant - Kitchen!fail - I saw you put rice in the toaster (Demon's Covenant - kitchen!fail)
    [personal profile] highlyeccentric
    Last Sunday I had lamb, but had to go get more ingredients before I could make Nagi's slow-roasted middle eastern lamb shoulder. I ended up running too late to make it in a slow-cooker, and still short a few items, so I had-hocked it a few ways. The leftovers turned out amazing though, kept going all week.

    ExpandSpiced Lamb Shoulder )

    Nagi serves hers with lemon herb couscous. I (being gluten-intolerant) recommend basmati rice, cooked with at least half the liquid being stock. You may wish to add sultanas to the rice.

    Recommended toppings:

    ExpandYoghurt sauce )

    ExpandFul Medames )

    Serve: Lamb on a bed of rice, with roast vegetables and the two dip/sauces.

    Leftovers 1: Same thing, minus the yoghurt if you're taking it to work to reheat. If carrying it in a container to reheat, do include an orange wedge, and a dash of extra water, to infuse with the rice.

    Leftovers 2: Ful Medames on celery sticks, as a component of Girl Dinner / Picky Tea.

    Leftovers 3:

    ExpandLamb and Feta Pizza )

    Leftovers 3b: Leftover pizza.

    Leftovers 4, which I made at the same time as the pizza:

    ExpandSpiced vegetable and bean soup )

    Leftovers 4b: soup. Mix yoghurt sauce through if you're taking it in a container to work.

    Leftovers 5: Wraps/soft tacos/thingy with fuul medames and lamb. If you have leftover mushroom / zucchini from the pizza, toss that in here. Add avocado if you have any.

    Leftovers 6: at this point just "uses for ful medames", but ful medames mixed with Jack M's banana chili ketchup makes a good spread base for breakfast burrito.

    This has been: a week of lamb and things that go with lamb.

    [pain] today's articulation

    Jun. 6th, 2025 11:53 pm
    kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)
    [personal profile] kaberett

    A significant part of the problem is that we only start saying "all pain is in the brain" (or "the tissue isn't the issue" or whatever) to people with complex or chronic pain.

    And there's a good reason for that! It's the same reason that I need to have a much more detailed idea of the fine detail of what an atom is and how it behaves than the vast majority of the population, for whom the Bohr model is perfectly adequate!

    ... and we need to explain that, we need to explain why we don't tell people with simple acute pain that All Pain Is In The Brain -- it's not because it's any less true for them, it's just that for most people most of the time they don't need to worry about that level of detail. But if you don't explain that, it sure do sound a lot like "your pain isn't real (unlike those people over there)".

    Lies-to-children. That. That thing. That's a thing I need to explain.

    various sizes of joy

    Jun. 5th, 2025 11:11 pm
    kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)
    [personal profile] kaberett
    1. On Tuesday, I picked a kohlrabi. The stem itself got eaten at the plot; the leaves I brought home to cook and eat subsequently rather than compost them. I stuck them in a glass of water to keep them going while I work out what exactly it is I want to do, and -- they are stunning. I am enjoying them so much every time I go past them: dark blue-tinged green leaves, pink-purple stems and veins (the cultivar is Azur; I do not currently have photos but will attempt to get my act together tomorrow.)
    2. I have four spikes of ginger, one thoroughly unfurled into leaves, and at least one more thinking hard about it. I do not expect to wind up self-sufficient in ginger but I am very much enjoying the experiment.
    3. a word you've never understood (Prophet, 9k words). I did not read it all in one gulp -- I paused to take notes -- and I'm now on my second read through, which could in theory be more of a gulp but mysteriously I seem to be taking more notes and also remembering that I wanted to shake the internet for more information about the experience termed "aftersensations", for Book Purposes. (Also I think I've lured another person into at least starting the book...)
    4. Asparagus for lunch! Still in season; still delicious.
    5. My house once again contains Large Quantities of hazelnuts and pecans. I Monch.

    September 2024

    S M T W T F S
    12345 67
    891011121314
    15161718192021
    22232425262728
    2930     

    Most Popular Tags

    Style Credit

    Expand Cut Tags

    Expand All Cut TagsCollapse All Cut Tags