August 18, 2017

primorial zoop!

Filed under: Uncategorized — Benjamin Vulpes @ 6:54 a.m.

Mircea Popescu asked for computations of the largest primorial to fit within first 515 bytes, and then 4096 later for reasonable reasons having to do with RSA padding and machine word widths. And so my adventures in remedial mathematics continue, with an implementation of the Sieve of Eratosthenes (which, no, I also had never heard about until Popescu mentioned it.

The sieve implementation is reasonable, although it struck me while writing this that the loop macro has quite clearly infected me to the point where Everything Must be Implemented in Terms of It. Also worth noting is the hilaribad hack of summing lists of primes sieved out from below 4096 and then re-sieving until a resulting list sums that is less than 2^4096.


(defun sieve (max)
  (let ((candidates (make-array (+ 1 max) :element-type 'bit :initial-element 1)))
    (setf (aref candidates 0) 0)
    (setf (aref candidates 1) 0)
    (loop for p from 2 below max
         (if (= 1 (aref candidates p))
                for multiple = (* p 2) then (+ multiple p)
                  (>= multiple (+ 1 max))
                  (setf (aref candidates multiple) 0))))
       for c across candidates
       for i = 0 then (+ 1 i)
       when (= c 1)
       collect i)))

(defun primorial (bits)
     for maxprime downfrom 4096
     and candidate = (apply #'* (sieve maxprime))
     when (< candidate (expt 2 bits))
     return candidate))

Runs handily in under a second on this computer:

Evaluation took:
  0.817 seconds of real time
  0.822183 seconds of total run time (0.800534 user, 0.021649 system)
  [ Run times consist of 0.053 seconds GC time, and 0.770 seconds non-GC time. ]
  100.61% CPU
  1,961,326,656 processor cycles
  191,607,056 bytes consed


Matching Diana Coman's and PeterL's. I recall mod6 confirming this number as well, but cannot find the log line. Do write in if you find it, listeners.

This excursion into the fascinating worlds of primes now complete, I'm going to return to my studies in remedial binary arithmetic (which are going fine, albeit slowly due to the annoying handicap of having my workstation not proximate to my sleep station; and a poverty of compute and space for compute away from the prying hands of toddlers in my current domicile; all of which are scheduled for remediation this fall, the orchestration of which is all very much under steam), which I'd left off in disgust recently having realized I was trying to write overgeneralized solutions the problem of reading a random n-byte integer from a byte stream.

There really is no better training ground for the intelligent, curious, and hardworking than The Republic of Bitcoin.

June 30, 2017

The End of Emissions Control

Filed under: Uncategorized — Benjamin Vulpes @ 4:01 p.m.

"Diesels: reliable startup and operation, high power, and low emissions: pick two".

Every single step along the road to the software-controlled car made perfect sense in its own context, and nobody could have predicted that baking what were once called "general purpose computers" into the automobile would result in the megastate's complete and humiliatinng defeat on the battleground of emissions control. The cascading failure started very small, with (for example) replacing the mechanical fuel injection systems with electro-mechanical ones; moved through a phase where every electromechanical subsystem (such as the motor controllers for the window actuators) was designed and emplaced separately; into the current phase where more or less every system in the vehicle is driven by its own tiny computer, and both dumps data to and reads instructions from the CAN bus.

Automotive computerization is actually a subinitiative of the USG fiefdoms commonly known as "corporations" push to replace real things in the market with erzatz imitations; a race-to-the-bottom that harmonizes gloriously with the symphony of fiat-currency issuing organizations: as exchange rates fluctuate not strictly as a function of how much currency a given country is issuing on an ongoing basis but more accurately as a function of how much more or less currency they issue relative to everyone else playing the same tune, so too do the reputations of once-glorious automotive brands fluctuate not as a function of the quality of goods they produce but as a function of how much more quickly or slowly their product lines' useful lifespan and quality shortens and degrades relative to their competitors; a vastly more difficult analysis for the consumer to make.

Simple products, for example carbonated and fermented corn syrups, achieved uniformity under the hood decades and decades ago in the States. With nothing material to differentiate the product lines, the marketers differentiated on brand: am I a Coke guy or Pepsi guy? Coors Light or Hamms? Trick question; once you incorporate corporate brands into your identity you're just another transmission vector for the mind-rape. Cars, while rapidly approaching the limit of uniformity between brands, are of markedly greater complexity under the hood than sodas and (what passes for) beer, and so demanded rather a lot more work on many more axes in order to give the marketers the hooks they needed to properly differentiate products for the American identity-politics market without costing undue piles to the actual engineering and fabrication processes.

Take engine noise as an example: the relentless market demand for constant improvement in both fuel economy and power output put such constraints on the design of power plants that the once-characteristic engine noise has been flattened out into the same low-waste white noise no matter the manufacturer brand. American marketers didn't mind this in the slightest, as where the drink manufacturers differentiated with various dyes, the car manufacturers differentiated by building speakers into the car so that they could tune both the noise broadcast to the world and that experienced inside the cockpit of the cars to more precisely curate "the brand experience of a Chevy".

German diesel marketers took a mildly divergent approach: instead of trading engine noise for power completely, and fabricating the "driving experience" wholesale with speakers, they worked with engine control unit manufacturers to tune the actual noise produced by the engine on startup. Why not? The startup routine takes no more than thirty seconds at the beginning of every petrol-burning run, has epsilon impact on emissions in the steady state, and so does not affect test-stand behavior sensibly.

With the innocuous ECU-profile-for-emotionally-tuning-the-consumer in hand, is it any surprise someone else in the organization repurposed the underlying routines to bypass witless regulators? Steering wheel position is constantly recorded to the CAN bus, as is that of every other system on the vehicle, all effectors read from the same rail, so why is it so implausible and disturbing that someone should have evaded the States' testing regime by applying a modicum of intelligence?

The notion that one can evade the state bothers millenial Pantsuit acolytes by demonstrating how blind and stupid the US megastate has grown. The laughs don't stop there, though, as the enforcement team only actually managed to track down the test-stand evasion systems by going to the ECU-modifying enthusiasts and asking nicely for dumps of the original software! Enthusiasts who'd already reverse-engineered, modified, and installed the modified control systems back onto their cars for performance reasons and to bypass the selfsame emissions compliance systems.

And so we find a sharp blade each for the jugular and femoral arteries of statal intervention in automotive emissions: a) the individuals and organizations responsible for writing and enforcing the regulations are utterly incapable of doing their jobs without volunteer labor from people who bypass emissions control in their spare time; and b) with the advent of flashable automotive ECU systems there is absolutely nothing preventing manufacturers from dropping cars on lots crippled by easily-removed software in a sarcastic bow to the regulatory apparatus, and nothing the state can do about their "leaking" high-performance engine maps in tandem. In regards to the first shiv, for as long as it is fashionable to be seen talking to cops, and right up until the moment Americans wake up to the notion that the entire control apparatus hinders self-determination and benefits only the criminal organization the once-modest United States Government has metastasized into, the bureaucracy may continue to find support among the people most well-equipped to castrate it and not a day past that point. In regards to the second, absolutely anyone can kick their engine controller into high-performance, high-emission mode as soon as they drive the vehicle off the lot, and with zero damage to the system replace the original software in the blink of an eye for inspections, switching back as soon as the inspector passes out of sight.

Expect to see a mandate that all cars with computers run Windows on chips with "trusted computing modules". Expect it also to never work.

May 20, 2017

Guardians of the Galaxy, Volume 2

Filed under: Uncategorized — Benjamin Vulpes @ 9:17 p.m.

The second issue in the Guardians of the Galaxy series is the most thickly dad-tastic flick I've ever seen come out of the modern American movie-making machine. Where the first movie makes light and gentle references to the bastard's feelings about his own illegitimacy (but only enough to satisfy the fandom's expectations in re: hewing to the canon), some wise producer somewhere let the writing team entirely off-leash and bought himself a movie about fatherhood, sacrifice, family, love and redemption that somehow doesn't actually suck1.

GotGv2 is the only kind of modern American movie to even consider seeing in a theater; it contains orgies of explosions and space-vehicle shoosting engagements, entirely-competent stunt-doubles, and (let's be real, the only reason to go see a show like this) an endless cornucopic phantasmagoria of the most syrupy and over-the-top special effects ranging from whatever that canon's equivalent of the hyperspace jump is, to epic battle scenes played out in the background as of a rotoscoped Vin Diesel dances around as an animate baby tree2. It's great! If you're into dad shit.

Returning to the topic of narrative design, the writers lay down thick beads of dad theme thick and fast from jump street: the overarching story moralizes on the evil of the man (hilariously ham-handedly named Ego) who'd drain the life force of his own children to further his own goals, while smaller arcs cover the damage done to sons whose fathers abandon them, the bond of sisterhood forged under abusive tyrants, the father who returns years too late to develop an actual relationship with his son, the value of any kind of fathering to the budding child, and the exaltations due the father who overrides his own rev-limiter and burns his tanks past empty stoking the fires of the worthy heir (which, hey, maybe "Star Lord" isn't that worthy outside of the movie's framework but within the narrative it's his second time very nearly dying to save the universe for a bounty of basically epsilon).

The writers want you to know that ignoring your kids until they can hold a conversation with you is terrible parenting3; spend a few delightful frames on the two sisters working through the vicious shit their father put them through and then hugging it out before setting out to kill him4; and that the family that lets its own members be their shitty selves provided they recognize how shitty they are and actively work to not be quite so much that all of the time can save the universe. Love is the greatest force in the world, etceteras etceteras.

Surprisingly for The Times In Which We Live, there are a few scenes that verge on being downright dark: Diesel's tree-baby catching the new-cabin-boy treatment from the mutinied pirate crew is sure to pluck the heartstrings of tender-hearted babes in your life, and might even bring the mothers to tears; and while the spacing of the temporarily-ex-captain's loyal lieutenants one by one could have been significantly more morbid and morose, we're going for a PG-13 rating here. To the writing team's credit, and one of the things that makes the movie in my opinion, when the pirate captain retakes his chair he hunts down and kills each and every single remaining mutineer aboard with palpable glee, demonstrable cruelty, and just the appropriate dash of theatrical flair.

For all the film's narrative upside, the Department of Rainbow Sparkles and Sparkly Rainbows would have benefitted from just a hint of discipline. In particular, the funereal fireworks display was unjustifiably bad, except as a throwaway callback to the redemption theme. There's absolutely no sense in following fifteen minutes of well-produced and -executed knock-down-drag-out god-vs-plucky heroes battle with a limp-wristed fireworks display.

GotGv2 is a fine piece of dad entertainment, and I'm endlessly amused that I saw it with my father, both of us entirely naive to its narrative makeup. It's got space battles, good versus evil, loss of honor and the quest for redemption, fruitless years of labor in the mines, love, and plenty of the classic "good ol' American family values". Not much by way of tits though, and the single whoring scene was so bad as to insult the profession.

  1. The "mother" figures attempt to guarantee the best possible progeny, while the fathers are first and foremost men making their tiny best of a shitty life in a hostile universe, discovering that hey maybe some of the kids aren't entirely a waste of everyone's time after all, and ensuring that at least they're not releasing children into the world who've never been punched. []
  2. Everyone parents the tree-baby. It's adorable, and an excellent example of dovetailing the comic relief character into the overarching themes of the movie. []
  3. Which, duh. Teach your kids at least two languages like a cultured human, s'il vous plaît []
  4. Doubly funny because a) deliberate middle-finger to Bechtel whiners, b) even the storyline about sisterly love and redemption by excuse of women doing whatever it takes to survive ends up being about a shitty dad. []

January 27, 2017

Gaze upon their works, ye mighty, and tremble

Filed under: Uncategorized — Benjamin Vulpes @ 10:17 p.m.

Chock full of fear, they stand at the barricades ready to resist...but precisely what is unclear, and as far as "how" goes, no more than a hissy-fit has emerged so far (archived).

Astonishingly uneducated, barely literate in most cases, accustomed to compassion and handouts from all and sundry, the body politic's weathervaning frightens them deeply. "Tax cuts mean service cuts", except for how there is no connection between tax receipts and United States Government expenditures (the deficit may increase or decrease from time to time, relative to the previous period but the absolute indebtedness of the US relentlessly and monotonically simply increases).

Everything must be free, except speech.

January 25, 2017

"Hey kid, want to buy some VERBOTEN HATE SPEECH?"

Filed under: Uncategorized — Benjamin Vulpes @ 9:27 p.m.

Guest post courtesy of $bzprtnr.

*Picture of sketchy dude in hat and trench coat, Rick and Morty voices.*

"Hey kid you wanna buy some VERBOTEN HATE SPEECH?"

"Wha-what’s that, mister?"

"Check it out I’ve got: national politics is a distraction; maybe democracy isn’t the best way to run a country; and the wage gap is statistically attributable to women leaving the workforce to raise children."

"Uhhh ohh that sounds uh, pretty good what else you got?"

"Protests are stupid and don’t change anyone’s mind; everything should be free; and the first standard deviation of human intellectual capability is wider than any democrat has ever imagined."

"Whoa uh, wow that’s some pretty serious stuff. Uhhhh what’s in that pocket?"

"Oh this, this my favorite trio, but uh, you got to take them all at once."

"Huh okay, wha-what uh, what are they?"

"Necessity of war for producing quality male specimens, inextricability of rape and pillage, and the unquenchable demand for pillage."


Older Posts »