Better HN
topnewbestaskshowjobs
Log inSign up

dave_universetf

523 karma · joined Mar 2, 2020 (6y ago) · 88 submissions

Submissions

comment 5mo ago · link · parent

The readme has strong LLM smells. Was the code written by an LLM as well?

What is your experience with cryptographic engineering, in particular avoiding common implementation pitfalls that bite first-time implementers of cryptographic primitives?

Are the primitives tested against Wycheproof vectors, and proofed against the common implementation mistakes they document?

comment 6mo ago · link · parent

It's vibe coded, so not surprising that it replicates the patterns of existing systems.

comment 7mo ago · link · parent

+1, the information content is nice, but the AI telltales and writing patterns were annoyingly distracting.

comment 7mo ago · link · parent

This is probably just a difference in how your brain and the author's work. A variety of home organizers have told me that people mean different things when they say they want an organized space. Some people want everything precisely labeled and sorted into narrow categories, and hidden away in drawers or closets. Others want everything visible and coarser categories. Each system looks and feels very distressing to brains of the other types.

It's especially a problem for people with ADHD, because the "very sorted and hidden" mode of organizing is heavily socialized as the _only_ way to be organized, but it's also the exact opposite of how (some) ADHD brains want to operate. OTOH the very exposed and "emergent" organization that works for an ADHD brain probably is mild torture to an OCD brain :)

For myself, the sorting system in this post looks pretty ideal. All the stuff is right there where I can see it and scan for what I'm after, it explicitly allows for emergent organization where classification happens incrementally over time, and the dots thing has near zero activation energy but still gives me long-term information I can use. It's much better than an electronic or "clean" inventory system precisely because I'll never be able to consistently keep using those, whereas slapping a dot on a box, even on bad brain days I can manage that!

comment 9mo ago · link · parent

Strictly speaking: no. The "forward pass" terminology does not imply that there exists a "reverse pass" that does the same kind of computation. Rather, it's describing two different kinds of computation, and the direction they occur in.

The forward pass is propagating from inputs to outputs, computing the thing the model was trained for. The reverse/backwards pass is propagating from outputs back to inputs, but it's calculating the gradients of parameters for training (rougly: how much changing each parameter in isolation affects the output, and whether it makes the output closer to the desired training output). The result of the "reverse pass" isn't a set of inputs, but a set of annotations on the model's parameters that guide their adjustment.

The computations of the forward pass are not trivially reversible (e.g. they include additions, which destroys information about the operand values). As a sibling thread points out, you can still probabilistically explore what inputs _could_ produce a given output, and get some information back that way, but it's a lossy process.

And of course, you could train a "reverse" model, one that predicts the prefix of a sequence given a suffix (trivially: it's the same suffix prediction problem, but you train it on reversed sequences). But that would be a separate model trained from scratch on that task, and in that model the prefix prediction would be its forward pass.

comment 9mo ago · link · parent

Both, with caveats. The attention computation is fundamentally quadratic: for every token in the sequence, you're doing a computation that has to compute over every other token in the sequence. So it's O(N) per token, O(N^2) for the whole sequence.

The big mitigation for this is that in causal transformers (i.e. all the chatbot type applications, where each token is only allowed to see tokens before it), you're running inference repeatedly on the same prefix in order to grow it by one token at a time. So if you cache the computations for tokens 0..N-1, on each inference pass you only have to compute O(N) for the newly added token at the end of the sequence.

That's why caching (and caching charges) appear so prominently everywhere in the pricing of inference.

In practice, caching is most beneficial at inference time, because you typically have relatively long conversations that start with the same cacheable prefix (the system prompt). At training time the same optimization can apply, but you're typically not pushing the same prefixes through the model repeatedly so you end up paying the quadratic cost more often.

The quadratic cost of attention is the fundamental compute bottleneck for transformer architectures, which is why there's research like this trying to find shortcuts in computing attention, as well as research into completely new primitives to replace attention (e.g. SSM, which is O(N) on a cold cache and O(1) on a warm cache).

comment 11mo ago · link · parent

I don't know about all hyperscalers, but I have knowledge of one of them that has a large enough fleet of atomic frequency standards to warrant dedicated engineering. Several dozen frequency standards at least, possibly low hundreds. Definitely not one per machine, but also not just one per datacenter.

As you say, the goal is to keep the system clocks on the server fleet tightly aligned, to enable things like TrueTime. But also to have sufficient redundancy and long enough holdover in the absence of GNSS (usually due to hardware or firmware failure on the GNSS receivers) that the likelihood of violating the SLA on global time uncertainty is vanishingly small.

The "global" part is what pushes towards having higher end frequency standards, they want to be able to freewheel for O(days) while maintaining low global uncertainty. Drifting a little from external timescales in that scenario is fine, as long as all their machines drift together as an ensemble.

The deployment I know of was originally rubidium frequency standards disciplined by GNSS, but later that got upgraded to cesium standards to increase accuracy and holdover performance. Likely using an "industrial grade" cesium standard that's fairly readily available, very good but not in the same league as the stuff NIST operates.

comment 1y ago · link · parent

I wrote MetalLB, a bare metal load-balancer for Kubernetes, because I needed one for myself. It gained some popularity because for a couple years, it was the only way to get working L4 LB outside of clouds. These days I believe a couple of the CNIs added support for external BGP peering and integration with k8s's LB machinery, but that came years later.

As a result, I became network troubleshooting tech support for a large chunk of people trying to run kubernetes on bare metal. If you've not looked at k8s's networking, debugging even your own cluster's networking is a nightmare, never mind debugging someone else's over slack, while (usually) simultaneously having to give them a crash course in intermediate/advanced networking stuff like asymmetric routing and tracing packets through netfilter so that you can then tell them that networks can't do the thing they wanted and no amount of new features I can add will change that.

Meanwhile companies selling bare metal k8s services started bundling MetalLB, but kept sending their customers to my bugtracker instead of taking some of the load themselves.

The experience burned me out severely. It's been several years and I still have a visceral negative reaction to the idea of open-sourcing code I wrote, and when I infrequently do they come with a fairly blunt "contributions no welcome" message and a disabled issue tracker. I handed over the keys to MetalLB a long while back now. I hope the new maintainers and the project are doing okay.

I'll mention a positive of that time as well, to balance it out: as an experiment I opened a pinned issue asking happy users to drop me a note (https://github.com/metallb/metallb/issues/5), and many did. It was nice occasionally getting a notification that wasn't a complaint or demand for support. At one point someone left me a note that it was being used to support research projects at NASA JPL and DARPA. That was pretty neat.

comment 1y ago · link · parent

Does the orange light specifically mean no RF link at all? Or does it include anything that prevents the modem from getting an IP address and route configuration? If the latter, BGP could still be at fault if it took out access to the control planes on the ground. But again all just guessing, from the outside all I see is the BGP routes are still being announced, and everyone seems to be seeing 100% packet loss and zero traffic.

comment 1y ago · link · parent

BGP is the canonical way to take your entire global network offline within seconds. Glancing at BGP looking glasses, Starlink's prefixes seem to still be announced, but there could still be an accidental blackhole or routing loop within their AS, or something broken in one of their transit providers.

No idea if that's what's going on, but routing protocols are one of a few effectively global control planes that can go wrong very quickly like this.

comment 2y ago · link · parent

They are/were scanning random public projects and creating unsolicited bugs in those projects to chide them about profanity in their source code. The linked thread is just a bunch of the victims of that spam having some fun with the format.

comment 2y ago · link · parent

In the case of this attack, somewhere between 40s and 30min of physical access, depending on how the card was set up. In the case of a hotel, the spicy card to clone would be the cleaning staff's, which conveniently also admits a reasonable explanation for the card going temporarily missing (e.g. abandon it one corridor over, oops must have dropped it while doing the rounds).

Depending on the specifics of a deployment, I'm guessing you could also use the card secrets to mint new cards that authenticate correctly to facility readers, but contain different information? But I don't know nearly enough about how these cards get used to know how much flexibility you get there.

comment 2y ago · link · parent

Indeed. Alas (or fortunately depending which colour team you work on), fully broken Mifare Classic is still all over the place, and likewise the "hardened" variant broken in this paper :(

comment 2y ago · link · parent

Possibly so. It just means that based on the report's findings, even if you'd decided to play it safe and buy exclusively from NXP directly (the creators of this ecosystem and owners of the MIFARE trademark), it looks like you could still end up with backdoored hardware.

comment 2y ago · link · parent

The paper reports that the same backdoor seems to be present in some NXP and Infineon SKUs as well, including some manufactured in Europe.

16.

MIFARE Classic: exposing the static encrypted nonce variant [pdf](eprint.iacr.org ↗)

250 points · by dave_universetf · 2y ago · 95 comments

comment 2y ago · link · parent

Yeah, admittedly it's confusing terminology generally, because it's still natural to say you're swapping the page tables out when you do a context switch on current systems. I probably do at some point in the post!

The distinction I was trying to get at was that, in early Unix, all process bytes were being actively streamed to and from disk as part of scheduling because the hardware didn't yet have a concept of virtual memory. So, if you wanted to make a program ready to run, you had to fully load it into memory, and shove anything else out of the way right then and there. That makes the scheduling function 5% deciding what should run, and 95% playing memory sokoban to make that happen.

OTOH, on systems with paged virtual memory, the scheduler is almost entirely "what's a good thing to run?", and implementing that decision is updating a couple of pointers. The only place the memory hierarchy creeps in, is if the scheduling algorithm wants to be fancy and account for things like NUMA nodes in its ranking of tasks.

I think it's reasonable, looking at it in isolation, to describe this part of the kernel as a "swapper", or the operation as "swapping". I think where it turns into a bear trap is when presenting these concepts to folks less familiar with kernel internals, where words like "swap" and "pages" are firmly the domain of the memory subsystem. And so, if I hand them a task and say "this is the swapper", IMO the majority will interpret that as being a component of virtual memory management, and they wouldn't be at fault for thinking that.

Empirically this happened in the 2008 wikipedia edit: "swapping" mutated to "paging" because in modern vmm-land that's a valid synonym, and that in turn became "this task is sometimes called 'sched' for historical reasons, and it handles paging" on the web. And cue a decade of confused students and stackoverflow users asking followups like "but if this task does paging, why does linux have all these kswapd threads?" That to me suggests that, for better or worse, the memory subsystem owns those words now, and the rest of the kernel has to be very careful if it uses them to mean something else, if it wants to avoid casual onlookers creating false associations. Something something naming things is still the hardest thing in computer science :)

comment 2y ago · link · parent

Please, name these academic Unixes! I would love to go see what they do. Down-thread there's a mention of minix, which does the normal thing: demand paging, context switches only the page table directory pointer, and process memory images are moved around the storage hierarchy indirectly, through page faults. Which other academic Unix or Unix-like did you have in mind?

Linux is indeed not the owner of the concept of PID 0. It's fortunate that I didn't say that! It is, however, not frequently involved with paging in and out memory.

comment 2y ago · link · parent

Also no. It was rolled back hours ago, and cache.nixos.org keeps all past builds so it didn't even need rebuilding.

Orthogonal to that, the backdoor was irrelevant to nix in at least three different ways: the malicious build logic targeted rpm/deb build environments and so didn't trigger in nix's build sandbox, the backdoor code makes assumptions about filesystem layout that are invalid on nixos and so wouldn't have activated anyway, and nix doesn't include the downstream patch that results in the backdoor even getting into sshd's address space. Still got rolled back out of an abundance of caution, but nix got lucky that the attacker didn't bother targeting it the way they did debian and rpm-based distros.

comment 2y ago · link · parent

It's not a problem, never has been. Nix mirrors all source bundles it pulls from third parties and caches them. cache.nixos.org has a copy of all the sources needed to build not just current HEAD, but also past commits (although deep history might start getting pruned for cost control soon, iiuc).

The Software Heritage archive also has an up to date mirror of xz's repo: https://archive.softwareheritage.org/browse/origin/directory...

comment 2y ago · link · parent

Worth noting that, like many immediate mode UIs, it seems to not integrate with OS accessibility infrastructure at all. That means any UI built with it will be a black box to anyone who needs accessibility tools like VoiceOver, text magnification, or semantic navigation.

Hopefully that's fixable :/

comment 2y ago · link · parent

Worth noting this is an expired draft. Anyone can publish drafts with no vetting. This particular author is also a frequent flyer of nonsensical IETF drafts that make no sense to anyone with a shred of understanding of how the Internet works. Genuinely not worth spending the time to understand, any more than you'd try to read a treatise about how the sky isn't real.

comment 3y ago · link · parent

Yeah I was imprecise in the description here, because I started trying to describe how a mechanical movement works and it went into the weeds really quickly :) More accurately, the balance nudges the pallet fork just enough to allow the escapement wheel to advance, and that advancing motion imparts some of the mainspring's force back through the pallet fork and into the balance, so that it continues to oscillate without dampening.

It's a very clever mechanism, and surprisingly subtle. I can't be the only one who first saw a running mechanical watch and thought "wait, isn't that perpetual motion? How does that springy thing keep going without stopping?" Not magic, it turns out, just very very careful engineering :)

comment 3y ago · link · parent

There's a sibling thread making the same point, and: yeah, I overgeneralized on that bit. The instance I had in mind was the M.A.S.H. TV show, which has a couple exchanges involving "hack" for time synchronization (unsurprisingly, by the most over the top soldierly characters). All I can offer as a defense is that it was late and I assumed that I couldn't remember others for that reason. But looking around now, film usually goes with the more recognizable "mark".

Here's a memoir from a retired USAF airman where he recounts what the hacking procedure looked like, though: https://code7700.com/2023_time_hack.htm

comment 3y ago · link · parent

It does seem a bit silly to me as well, given the stresses that watch movements are subjected to day to day, and that the hack's mechanical design barely touches the balance at all. It doesn't take very much friction at all to halt these movements, so I struggle to see where the source of damage would lie. But, people have their opinions.

And yeah, mechanical movements are technological marvels, and can keep incredible time for being a completely analog machine... But seconds per day is still about as good as it gets unless you take expensive measures (like the marine chronometers did) to get diminishing returns. And less expensive or well tuned movements can easily drift by a minute or two per day.

In a way, we've been spoiled by quartz and electronic timekeeping. Now that GPS blankets the world and lets any timepiece continuously synchronize to within microseconds, "seconds per day" sounds ludicrous. And yet, it built empires and ran the world for a couple centuries! Especially for civilian use, it's rare to truly _need_ better precision, aside from the general desire for perfection.

comment 3y ago · link · parent

Could well be! I have no specialist knowledge, I just got curious about the origin of the fairly random feature name, and went digging. The two well substantiated facts are:

Hacking movements gained popularity between WW1 and WW2 due to army interest (and during WW2 US mil-spec for watches required a hacking feature, leading to e.g. the Elgin A-11 hacking watch).

In the heyday of mechanical marine chronometers (late 18th century through early 20th, roughtly), common use was to set a hack watch to the sheltered ship chronometer, then go above deck with the hack watch to make observations.

The link between these two facts is more tenuous, and basically boils down to: watches with a hacking mechanism would obviously be really handy for marine use, given how the hack watch was used; and military terminology routinely bleeds between the services, so transposition from a navy to an army context around WW2 wouldn't be surprising.

As for why the Royal Navy called these watches hack watches... I pretty much just ran down the dictionary definitions of "hack", including the archaic uses that would have been commonplace in the late 18th century, and made an educated guess. I would hope that there's a book out there somewhere about this era of sailing that has a more substantiated take, but I don't have such a reference myself.

comment 3y ago · link · parent

There is also a feeling by some horologists and watch fans that the hack interacting with the balance oscillator and suddenly halting its motion is detrimental to the movement's health and precision. I haven't found any data to substantiate this, but I'm told that some watch aficionados prefer non-hacking movements for that reason.

comment 3y ago · link · parent

We do. This is also not our own insight/invention, to be clear. We're implementing the spiritual core (but not the SIP clothing) of the ICE protocol (https://datatracker.ietf.org/doc/html/rfc8445), which was developed by Google and the XMPP foundation as part of Jingle, the XMPP extension for p2p voice and video. That same stuff lives on in browsers today as part of WebRTC.

ICE in particular provides a model for probing potentially feasible datapaths, selecting the best if multiple paths are available, and suggests how to handle datapath failure.

It's not a weekend's worth of hacking to get it working robustly, but it's also very doable.

comment 3y ago · link · parent

That is not accurate to our experience. Mobile devices on cell networks see about the same amount of success with p2p connections as other devices. Mobile networks differ vastly in their behaviors when it comes to NAT traversal, and you can certainly find specific carriers that behave poorly, but it's far from the death of p2p that you describe.

That said, you _do_ need last-resort relaying, not just for the more difficult mobile networks but for all kinds of edge cases (e.g. the UC Berkeley guest wifi case I mentioned in the article). So in that sense, the purist argument is that p2p is impossible since you will always need to have relaying as an option. But the key is that p2p works well enough to make the relays economically viable to operate, and that _some_ connectivity is usually sufficient, even if it's not the theoretically optimal connectivity.

Plus, IPv6 continues to be deployed (and AWS charging for IPv4 is another step on that path), so while some CGNAT deployments work to degrade p2p, IPv6 in parallel is restoring better p2p connectivity than IPv4's allowed for decades. It's not all roses, but it's possible to be optimistic about a future where cloud servers aren't the only option.

123