in switzerland you aren't allowed to have a train with exactly 256 axles because of an integer overflow in the axle counting machine
i wish i could fix my software bugs by making it illegal to cause them
in switzerland you aren't allowed to have a train with exactly 256 axles because of an integer overflow in the axle counting machine i wish i could fix my software bugs by making it illegal to cause them 81 comments
die züge können keine 256 achsen haben! wie lächerlich! "gnädige frau, das ist ein mcdonalds." @hikerus5 @lynnesbian nicht in Europa, aber es fahren regelmäßig Güterzüge mit mehr als 200 *Wagen* in den Vereinigten Staaten und anderen Ländern https://en.m.wikipedia.org/wiki/Longest_trains @hikerus5 @lynnesbian Es gibt die Rollende Landstraße, deren Wagen haben 12 Achsen (Sdmmrs). @Aglaia89 @hikerus5 @lynnesbian die haben zum Glück immer(?) noch hinten dran einen Schlafwagen :D @dingens @hikerus5 @lynnesbian Ein RoLa Wagen weniger und 3 Schlafwägen oder 2 Schlafwägen und Doppeltraktion und schon ist das Problem wieder da. Theoretisch könnte man das auch mit 6-Achsigen Schwerlast Flachwagen passieren, da wird aber das Zuggewicht von ~5500t zum Problem. @lynnesbian But then a) You'd let everyone know how to break your software, and b) Unruly teens would constantly break your software, because of Crimes @RedFuture ah but, it's illegal to break the law, so they simply would not do it @RedFuture @lynnesbian gathering with my friends after school to build a train with exactly 256 axles, as a prank @lynnesbian proposed fix: mandate the ETD (https://en.m.wikipedia.org/wiki/End-of-train_device) must be mounted on a little cart with 3 axles. Every train will need exactly one @lynnesbian can't happen to us in Germany. We still have things like manual or mechanical operation of these things ;) Only a fraction is electric ;) @sindastra yes, really. There is still Hardware from the kaiserreich in use today ;) @Drezil @lynnesbian you can still have an integer overflow in a mechanical counter. it's just more likely to be a decimal limit at rollover, not a binary one. automotive mechanical odometers were susceptible to this, as a 5+1 decimal digit mechanical counter. so you'd hit rollover at 100,000 DISTUNIT. my family has a car that's done it. our newer car has a digital Trip-O + Odometer with 6 digits, no tenths for the Odometer, just the Trip-O, so it'll hit rollover at 1,000,000 DISTUNIT @lynnesbian it's like that xkcd comic where the guy named his kid DropTable.Student except better because it's real and involves trains @lynnesbian I think the original limitation was caused by mechanical counters with eight physical bits (so, not actually software), which have now been phased out. @draemmli @lynnesbian @lynnesbian Whoops, link [1] was supposed to be this: http://eisenbahnberatung.ch/Dokumente_Web/R%20I-30111.pdf @draemmli thanks for clearing this up! i managed to find a slightly more recent document mentioning it, but you're right, it seems to have disappeared now @lynnesbian if law is the code that runs society' isn't this just a patch to workaround a potentially deadly bug? @lynnesbian Shouldn't it be "equals or exceeds"? Like, if it hits 256 on the counter and resets to zero, wouldn't it then be under-reporting the length of the train as L-256, which could still lead to issues? (I dunno, maybe I'm not parsing this right, much like a Swiss axle-counter. Time for another eggnog latte.) @drimplausible @lynnesbian IIRC it's perfectly okay to have 255 or 257 axles, because the relevant bit of code is only worried about if there is a train there or no train there. That 257 overflows to become 1 still shows up as a train @drimplausible Yes, but that doesn’t matter. The next counter has the same bug and thus counts the same number of axles, so the result will be correct. Let’s say it has 258 axles. First sensor will report “train with 2 axles has entered the segment”. Second sensor will report “train with 2 axles has left the segment, clear the signals.” Everything is fine. @lynnesbian could it be a hardware issue? The sensor on the track only having one byte for counting. @palinor5 @datenhalde Maybe after counting to 255 the axle 256 sets the whole thing to 0 - so no more train on the tracks. Axle number 257 and following would be recognised as a train again. @maikek yeah, we can agree on that. But why even counting, then? Making sure simultaneously that all cars left a segment by count comparison? @datenhalde That would be my guess too. When I talk to my brother next time I will ask him - he works as an engineer in that area. @maikek @datenhalde Yup, that's how the "track is occupied" is working if you use axle counters. You count-in on entering and on leaving the track again you count-out. As long as your counter is != 0, the track will be marked as occupied for the interlocking system. 🤷🏼 @maikek @datenhalde Sometimes these systems also miscount, leading to the track being still occupied from the systems view, when it's actually not anymore.😶🌫️ @lynnesbian 64 car train, or building a locomotive with enough tiny wheels to zoop around making Swiss rail crimes @dougschuler @lynnesbian Presumably yes. It seems like it would be counted as one axle on the track. I hope that doesn't trigger another error in their code :-) @dougschuler @lynnesbian the German is so worded that it means 256 or more. It just isn't easy to convey in English. Patient: "Doc, I get a sharp pain in my side whenever I lift my arm over my head." Doctor: "Then don't do that." @slothrop @lynnesbian @abby We do the IT for the UK arm of a swiss rail company, and we probably have a copy of the old documentation for this still in the system... ;) @lynnesbian @ireneista every time I’m reminded of this I am again really bothered that they don’t ban all _multiples_ of 256 @nina_kali_nina @steve @lynnesbian @ireneista Claire recently told me a joke in which a Genie is granting wishes, and the grantee is not allowed to ask for more wishes, so their first wish is to ask for 0. The punchline is that upon granting it, the Genie then says "now you have 255 wishes!" @steve @lynnesbian @ireneista 512 axles are probably not allowed for being too long, anyway. The maximum length is normally 1km, and that would mean comically short cars even if they had more than 2 axles each. @eseilt @lynnesbian @ireneista yeah. I understand the pragmatics, but the language standards brain can’t really be turned off. @lynnesbian @yildo @lynnesbian one should more often than not keep inspirations like this to themself @lynnesbian@fedi.lynnesbian.space considering the effects of going over 256, I'd assume this was not written by anyone remotely technical @lynnesbian For the same reason, trains in Germany are limited to 252 axles (safety margin to 256) @lynnesbian thanks for sharing! I remember @Girgias mentioning that at the #phpday2024 few months ago too! @attie @lynnesbian multi-section overlap! I wonder what would happen to an interlocking system if a train triggered consecutive axle counters. that would be a nightmare of safety alarms. @lynnesbian we've done that at work @lynnesbian @lynnesbian My immediate thought when I saw this was "1st generation popular microprocessor", e.g. 8080, 6800, 6502, etc. These days with 64 bit processors, the forbidden number would be 18,446,744,073,709,551,616 and I don't think Europe, let alone Switzerland, would have enough rails to hold that train(*) - - - - - - - (* Yes I know that the length of that train would be over a million times the distance to Alpha Centauri and I doubt Swiss federal law would operate well at that distance) @lynnesbian this is exactly what the uk government did about people naming companies with code injection attempts. @lynnesbian /me imagines international terrorists taking notes... "If we could just......." 🤔 😂 @lynnesbian on the British railway, a train service cannot be planned to start, pass, call or terminate at more than 150 locations because the structured mainframe datafiles used to hold train paths can only hold this number of timing points for a given path @wnd @lynnesbian timing points? You mean they're supposed to stick to a timetable or something? This does not match up with my experience on British railways. @InsertUser @lynnesbian top snark but misses the point. This is a technical point about the timetable not about the operation of the timetable. @InsertUser @lynnesbian it's a shame that with your erudition you are unable to resist the urge to share your obvious wit with others @wnd It's a pity that you can recognise wit, but somehow today can't realise that wit can depart from reality for comic effect. @lynnesbian Oh, I heard that before at work. I'm pretty sure the axcel counter with that particular problem was designed by my coworker xD That thing was programmed in assembly and only had analog relays as an interface. It's not even produced anymore, but has a lifespan of like 30 years, and railway operators don't just replace working equipment. Though it is strange that this is a law. Usually such "safety requirements" are handled by the railway operator. @lynnesbian my whole idea about Switzerland has changed now, prejudice it was, but still... #swissprecision |
the source everyone reports for this PDF is gone, and it's not exactly easy to find swiss train law documentation when you don't even speak german
but here's a current link: https://www.hech.ch/wp-content/uploads/2018/07/I-30111_09122018_Anhoerung.pdf
page 123, section 4.8.4 "Zugbildung"