WTF Bites


  • Considered Harmful

    Screenshot_20240612_185128_Whataburger.jpg

    I can't update my profile because my last name can't contain numbers. I can't fucking fix it, because it's a readonly autopopulated field. And I can't change anything else on my profile because of the validation error.


  • Notification Spam Recipient

    @HardwareGeek said in WTF Bites:

    @hungrier said in WTF Bites:

    go back with the arrows

    656a6e96-0b75-4f67-a2d6-dcf81cc8b05d-image.png

    I do too, but it's not easily discoverable, so I forget they exist.

    I do, if I swipe the bottom bar over to them. They work about as well as can be expected.

    Screenshot_20240612-220914_Chrome.png



  • @Tsaukpaetra said in WTF Bites:

    They work about as well as can be expected.

    Considering the source, my expectations are very low.


  • BINNED

    @hungrier said in WTF Bites:

    @kazitor said in WTF Bites:

    @HardwareGeek said in WTF Bites:

    Incidentally, autocarrot on my phone seems to have just learned the word autocarrot. I wonder if it will continue suggesting it as a potential completion if I haven't just typed it recently.

    My phone still suggests made-up words I haven’t used in five years.

    Like rhamphorhynchus? :tro-pop-wave:

    I’m still using that one 🏆



  • @dkf said in WTF Bites:

    @Bulb said in WTF Bites:

    Unfortunately nobody in the PHP project realized just how obnoxious Windows is.

    Or they realised, but didn't want to deal with all that bullshit for a non-primary-target platform.

    And the non-recommended method of running it at that. Starting PHP via CGI on Windows is so horrible idea even Cthulhu would not approve.



  • @error said in WTF Bites:

    my last name […] it's a readonly autopopulated field

    :sideways_owl:          :wtf_owl:          :wtf_owl:          :sideways_owl:          :sideways_owl:          :wtf_owl:     :sideways_owl:          :wtf_owl:          :sideways_owl:          :wtf_owl:

    Que, kurwa?



  • @Bulb except that PHP-FPM isn’t available on Windows so unless you have something that connects nicely (like Apache with a dedicated connector) pretty sure you’re in for the CGI connector.


  • Notification Spam Recipient

    @Bulb said in WTF Bites:

    @error said in WTF Bites:

    my last name […] it's a readonly autopopulated field

    :sideways_owl:          :wtf_owl:          :wtf_owl:          :sideways_owl:          :sideways_owl:          :wtf_owl:     :sideways_owl:          :wtf_owl:          :sideways_owl:          :wtf_owl:

    Que, kurwa?

    Presumably because that portion of the profile was populated via external login provider that that site obviously can't update. The issue is that the validation code does not disable from that sate.



  • @HardwareGeek said in WTF Bites:

    @Gurth Holding the spacebar just causes the CPU to overheatbrings up the menu to switch keyboard languages, and swiping does nothing.

    You’re not on iOS/iPadOS, I take it, then? Because on those, it moves the text cursor.


  • 🚽 Regular

    @error said in WTF Bites:

    I can't update my profile because my last name can't contain numbers.

    It's been 4 years since X Æ A-12 was born. Have these people no heart?



  • @Zecc Last name: Musk. No numbers, validation passed ✅


  • BINNED

    @Zecc said in WTF Bites:

    @error said in WTF Bites:

    I can't update my profile because my last name can't contain numbers.

    It's been 4 years since X Æ A-12 was born. Have these people no heart?

    Scientists invent new drugs.
    🍈:

    https://youtu.be/2i3zrzyLOCw



  • @Gurth said in WTF Bites:

    You’re not on iOS/iPadOS, I take it, then?

    Hell, no!

    On Android, I have to press a meaningless button with 4 squares, and then press a button labeled (at least it has a text label) "Text editing". That gives me arrow buttons (as well as select, select all, copy, paste, something I don't remember, and a couple of buttons I would expect to work like Ctrl+left/right arrow, or maybe Home/End, but which actually function like Ctrl+Home/End. Not too difficult to access, but undiscoverable unless you are in the habit of pushing random buttons of unknown purpose, especially the one that's basically a hamburger menu button, but with a special label.


  • Discourse touched me in a no-no place

    @HardwareGeek TIL. I've literally never noticed that before.



  • @error said in WTF Bites:

    Screenshot_20240612_185128_Whataburger.jpg

    I can't update my profile because my last name can't contain numbers. I can't fucking fix it, because it's a readonly autopopulated field. And I can't change anything else on my profile because of the validation error.

    How do they treat Umlauts or odd strokes?
    Just thinking of Ms. Dörte Müller.


  • Considered Harmful

    @BernieTheBernie said in WTF Bites:

    @error said in WTF Bites:

    Screenshot_20240612_185128_Whataburger.jpg

    I can't update my profile because my last name can't contain numbers. I can't fucking fix it, because it's a readonly autopopulated field. And I can't change anything else on my profile because of the validation error.

    How do they treat Umlauts or odd strokes?
    Just thinking of Ms. Dörte Müller.

    Have you heard of China Syndrome?



  • @dkf said in WTF Bites:

    @HardwareGeek TIL. I've literally never noticed that before.

    I think I had encountered it before, but I'd forgotten how to do it until I specifically went looking for it yesterday. Now that I've found it again and written a detailed description, I'm much more likely to remember and use it. No guarantees, though; the CRS is strong in this one.


  • ♿ (Parody)

    This example is where things get slow:

    let address = "127.0.0.1"
    let username = "steve"
    let password = "1234"
    let channel = 11
    
    let url = "http://" + username 
                + ":" + password 
                + "@" + address 
                + "/api/" + channel 
                + "/picture"
    
    print(url)
    

    swiftc spends 42 seconds on these 12 lines on an M1 Pro2, only to spit out the notorious error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions.


  • Notification Spam Recipient

    @boomzilla said in WTF Bites:

    This example is where things get slow:

    let address = "127.0.0.1"
    let username = "steve"
    let password = "1234"
    let channel = 11
    
    let url = "http://" + username 
                + ":" + password 
                + "@" + address 
                + "/api/" + channel 
                + "/picture"
    
    print(url)
    

    swiftc spends 42 seconds on these 12 lines on an M1 Pro2, only to spit out the notorious error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions.

    **smiles smugly in Java**


  • 🚽 Regular

    @boomzilla The expected error should of course be "why are you sending username and password in plain HTTP, you idiot?"



  • @boomzilla

    As a lower-bound estimate, just considering the five string literals could be nine possible types results in 59,049 combinations.

    Sure, it says lower bound, but it's also 2024 and 60k is a tiny number. That lower bound doesn't explain why it would take 42 seconds to not complete the task.

    My friends within Apple tell me that they have just learned not to write expressions beyond a certain length in order to keep compile times reasonable. I’ve heard similar stories from friends on Delta’s iOS team and at other companies.

    :facepalm:


  • Considered Harmful

    @boomzilla said in WTF Bites:

    Why Swift's type checker is slow not at all swift 🐠


  • BINNED

    @cvi also that time out makes me curious. On the one hand, I don’t want to wait 8 years before I get a compiler error. On the other, I’d prefer the compiler to be deterministic and builds succeeding or not not depending on how much load there was on the build server.



  • @topspin Yeah. I think I'd prefer a diagnostic ("Hey, statement/expression X on line Y has taken more than Z seconds to type check"). Z should probably be a lot lower for a single statement/expression (<10 seconds? <1 second?). For interactive builds I can then decide if I want it to continue or abort.

    Maybe there should be a compiler option to abort with an error (e.g., if you build stuff in the cloud and don't want to run up an eye watering AWS bill just because somebody tried adding an int to a string in the wrong place).



  • @cvi said in WTF Bites:

    if you build stuff in the cloud and don't want to run up an eye watering AWS bill

    Hey! That's an absolutely classified business secret of all cloud providers! How can you so blatantly tell it here publicly?


  • Discourse touched me in a no-no place

    @cvi said in WTF Bites:

    That lower bound doesn't explain why it would take 42 seconds to not complete the task.

    Every possible combination of types needs to be checked. Even the vast number of absolutely insane ones.



  • @boomzilla said in WTF Bites:

    a really fancy bi-directional Hindley-Milner type checker

    Really fancy, but better suited to functional languages. Following to the linked documentation...

    The Swift language contains a number of features not part of the Hindley-Milner type system, including constrained polymorphic types and function overloading, which complicate the presentation and implementation somewhat.

    And this is the bit that is slowing it all down.

    On the other hand, Swift limits the scope of type inference to a single expression or statement, for purely practical reasons: we expect that we can provide better performance and vastly better diagnostics when the problem is limited in scope.

    I'm not sure when solving a stack of simultaneous equations that performance improves if you limit yourself to only solving a few at a time.


  • Discourse touched me in a no-no place

    @Watson The crazy bit is that they're considering all sorts of types for operations like + despite having the argument types right there. Yes, the entire space of types is large (causing an exponential explosion in the number of possibilities as the number of arguments goes up), but it shouldn't need to be traversed to type the expression unless you write some very type-agnostic code indeed.



  • @dkf said in WTF Bites:

    but it shouldn't need to be traversed to type the expression unless you write some very type-agnostic code indeed.

    Article links to something it calls "ExpressibleBy protocols". From a very superficial glance at the linked documentation, it seems you can define that a custom type be constructed from literal values (page starts with "Allow values of your type to be expressed using different kinds of literals."). I guess there exist a bunch of types that can be expressed as a string literal.

    Turning the channel variable into a string in the example cuts the compile time (tried on Godbolt) to normal-ish.

    So, I'd guess the following is happening:

    • It uses + with string arguments. Except that's an error due to channel.
    • It now goes off finding some sort of combination of types that can be expressed as string literals (and an int literal) that would make the code valid.

    despite having the argument types right there

    So, yeah, it tries those, but then goes "oh shit" and zooms off into desperately trying to find some combination of random-ass types that make that work.

    Filed under: And people say SFINAE is bad.


  • Considered Harmful

    Red Dead Redemption 2, an NPC has asked me to "please be discrete [sic]."

    1 out of 5 stars. I'd rather be continuous.


  • BINNED

    @error that’s much easier to model, but molecules/atoms/elementary particles have been around since Ancient Greece and been conclusively discovered at least a century or two ago.


  • 🚽 Regular

    @topspin said in WTF Bites:

    molecules/atoms/elementary particles have been around since Ancient Greece

    I thought they'd been around since the Big Bang?


  • BINNED

    @Zecc :um-actually: it took a few minutes for nuclei, and 380k years for molecules.

    IMG_2539.jpeg


  • 🚽 Regular

    @topspin said in WTF Bites:

    @Zecc :um-actually: it took a few minutes for nuclei, and 380k years for molecules.

    My ε is smaller than yours, but not zero.


  • Trolleybus Mechanic

    2024-06-15_08-43-2.png

    Tried to add a guest (my spouse) to a hotel reservation. There are multiple WTF. A postal code has no operational or regulatory reason to be required. The form does not mark it as required field. Not obvious from the screenshot, but the form requires me to register a new password, WTF?






  • Considered Harmful

    @cvi said in WTF Bites:

    @dkf said in WTF Bites:

    despite having the argument types right there

    So, yeah, it tries those, but then goes "oh shit" and zooms off into desperately trying to find some combination of random-ass types that make that work.

    I'm not sure I want to know why they can't fix the vast majority of degenerate cases by simply searching the types in a particular order, builtin ones first. "Can I solve it by assuming a cigarstring literal is just a cigarstring literal? No? What about using types directly derived from builtin types then? etc."



  • @LaoC It does that. If the expression checks without needing any type conversion, the compilation is quick. But if there is a problem, it tries way too many things before concluding it does not check.


  • Discourse touched me in a no-no place

    @Bulb It also sounds generally not very fast for some reason. Not at all sure why.



  • @dkf said in WTF Bites:

    @Bulb It also sounds generally not very fast for some reason. Not at all sure why.

    It makes me think of the Natural Language Processing project I did back in college. That project took an English sentence and determined if it fit the grammar and vocabulary I'd defined by pushing expansions of the rules onto a stack until it found a match or ran out of things to try. It took my Commodore 128 a minute and change to process a 12 word sentence and print the matching structure(s).

    So in this horribly-optimized imaginary example the Swift type checker starts with a bunch of StringLiterals and an IntegerLiteral. The speedup hack in it tries the simplest conversions: all StringLiterals to Strings and the IntegerLiteral to Int. That fails since there's no "operator+(String, Int)" equivalent. Now it has to try everything else, so it pushes the expanded expression on a stack, pulls it back off, and pushes back versions with the first StringLiteral replaced by all 9 things it converts to. Next it pulls one and replaces the first + with all the possible "operator+"s, then 9 more things that a StringLiteral can become, and so on until the entire expression is concrete types and functions. That it checks and finds that the first one fails since "operator+(Int, Int)" doesn't take whatever the StringLiterals became, so it throws that one away and pops the next one, and the next, and the next, and so on until it times out. ⏲


Log in to reply