Email or username:

Password:

Forgot your password?
Lynnesbian :bune_ylw:

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

to avoid falsely signalling a section of track as clear by resetting the axle counter to zero, and thus to avoid collisions, the total number of axles in a train must not equal 256
81 comments
Lynnesbian :bune_ylw:

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: hech.ch/wp-content/uploads/201

page 123, section 4.8.4 "Zugbildung"

Lynnesbian :bune_ylw:

die züge können keine 256 achsen haben! wie lächerlich!

"gnädige frau, das ist ein mcdonalds."

Hiker

@lynnesbian 256 Achsen wären dann 64 4achsige Wagen - solche Züge gibt es nicht,

Lydia Trivia

@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 en.m.wikipedia.org/wiki/Longes

Aglaia89 🏳️‍⚧️ :verified:

@hikerus5 @lynnesbian Es gibt die Rollende Landstraße, deren Wagen haben 12 Achsen (Sdmmrs).
21 von diesen Wagen plus eine Lok mit 4 Achsen und du hast genau die 256 Achsen auf rund 400m Zuglänge

@dingens

@Aglaia89 @hikerus5 @lynnesbian die haben zum Glück immer(?) noch hinten dran einen Schlafwagen :D

Aglaia89 🏳️‍⚧️ :verified:

@dingens @hikerus5 @lynnesbian Ein RoLa Wagen weniger und 3 Schlafwägen oder 2 Schlafwägen und Doppeltraktion und schon ist das Problem wieder da.
Aber ja, da ist schon eine besondere Konstelation aber nicht komplett ausgeschlossen.

Theoretisch könnte man das auch mit 6-Achsigen Schwerlast Flachwagen passieren, da wird aber das Zuggewicht von ~5500t zum Problem.

potpie

@lynnesbian Hard to find? Who's your Swiss train law documentation guy?

Th0mms3n

@lynnesbian Sadly it already seems to be gone, at least it's not available for me.. :(

Red Future

@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

Lynnesbian :bune_ylw:

@RedFuture ah but, it's illegal to break the law, so they simply would not do it

crab

@RedFuture @lynnesbian gathering with my friends after school to build a train with exactly 256 axles, as a prank

Red Future

@operand @lynnesbian Building a train with -1 axles to block out huge sections of track

Robert

@lynnesbian proposed fix: mandate the ETD (en.m.wikipedia.org/wiki/End-of) must be mounted on a little cart with 3 axles. Every train will need exactly one

Drezil :butterfly_trans:

@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🐧✅:~ # _

@Drezil Really? That would explain why nothing train related works in Germany. 😆

Drezil :butterfly_trans:

@sindastra yes, really. There is still Hardware from the kaiserreich in use today ;)

hyratel

@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

Dabdullah Öcalan

@lynnesbian it's like that xkcd comic where the guy named his kid DropTable.Student except better because it's real and involves trains

Draemmli-Ersatzbus

@lynnesbian Oh hey! I'm the person who originally submitted this to reddit.

As far as I know, this rule is no longer in place. It still shows up in some recent-ish documents (like [1]), but a train driver I know showed me a screenshot of a document explicitly stating that this paragraph was made obsolete.

It also doesn't show up in the current R 300.5 anymore. [2]

[1]: bav.admin.ch/bav/de/home/recht

[2]: bav.admin.ch/bav/de/home/recht

@lynnesbian Oh hey! I'm the person who originally submitted this to reddit.

As far as I know, this rule is no longer in place. It still shows up in some recent-ish documents (like [1]), but a train driver I know showed me a screenshot of a document explicitly stating that this paragraph was made obsolete.

Draemmli-Ersatzbus

@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.

ospalh

@draemmli @lynnesbian
Otoh, the German LZB linear train control is 8-bit to its core. One sector is up to 12.7 km long, 127 × 100 m loop sections, for signed 8-bit position counters.

Lynnesbian :bune_ylw:

@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

Hiker

@lynnesbian In Switzerland you will never have a trains with 64 railway cars with 4 axles.

Local Agency

@lynnesbian if law is the code that runs society' isn't this just a patch to workaround a potentially deadly bug?

Dr.Implausible

@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.)

Alan Bellingham

@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

Ysegrim

@drimplausible @lynnesbian Axle Counters are not about reporting the length. They are about "The same number of axles and thus cars that went in on the beginning of the block left it at the end of the block". (Or even, on either side, in case of reversing / split trains). Which is equivalent to what we're interested in, namely, "There are no cars left in the block, and we can leave the next train in at full speed".

So as long as the counter doesn't remain at 0 when the full train is in, an overflow isn't much of a problem. (Bad edge case: The train stops after exactly 256 axles have been counted in)

@drimplausible @lynnesbian Axle Counters are not about reporting the length. They are about "The same number of axles and thus cars that went in on the beginning of the block left it at the end of the block". (Or even, on either side, in case of reversing / split trains). Which is equivalent to what we're interested in, namely, "There are no cars left in the block, and we can leave the next train in at full speed".

toni✨🧠

@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.

palinor5

@lynnesbian could it be a hardware issue? The sensor on the track only having one byte for counting.

Jean Luc POI I7FI

@palinor5
What about more than 256 axles? In the original instructions, there is no hint of an overflow, just the exact number that is not to be met.
@lynnesbian

Maike

@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.

Jean Luc POI I7FI

@maikek yeah, we can agree on that. But why even counting, then? Making sure simultaneously that all cars left a segment by count comparison?

Maike

@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.

9Lukas5 🚂 🐧

@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. 🤷🏼

9Lukas5 🚂 🐧

@maikek @datenhalde Sometimes these systems also miscount, leading to the track being still occupied from the systems view, when it's actually not anymore.😶‍🌫️
That's then a case when the next train will be sent in "on sight" and has to report back. 🕵️
Then the dispatcher can reset the counter for that track. 👍🏼

Jernej Simončič �

@palinor5 According to this it was a physical device with 8 "bits", but they've been phased out, so the no 256-axle train rule has been removed.

Palmer Dabbelt
@lynnesbian that explains why the RISC-V people like trains so much!
patter

@lynnesbian 64 car train, or building a locomotive with enough tiny wheels to zoop around making Swiss rail crimes

Stefan Ihringer

@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 :-)

Marc Etienne

@dougschuler @lynnesbian the German is so worded that it means 256 or more. It just isn't easy to convey in English.

Jerry

@lynnesbian

Patient: "Doc, I get a sharp pain in my side whenever I lift my arm over my head."

Doctor: "Then don't do that."

Camilo

@lynnesbian lobbying arm of the association of computing machinery when?

Rocketman

@lynnesbian I work in IT for rail, and I’ll instantly believe this

Chloe Raccoon

@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... ;)

Elen Le Foll 🇫🇷 🇬🇧 🇩🇪

@lynnesbian Just checking my calender in case today is actually 1 April... 🤯

Steve Canon

@lynnesbian @ireneista every time I’m reminded of this I am again really bothered that they don’t ban all _multiples_ of 256

zarbet

@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!"

Simon Eilting

@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.

Steve Canon

@eseilt @lynnesbian @ireneista yeah. I understand the pragmatics, but the language standards brain can’t really be turned off.

Festive Leo ✨🇺🇦

@lynnesbian
Tired: Solving technical problems with technical solutions.
Wired: Solving social problems with technical solutions.
Inspired: Solving technical problems with social solutions.

HyperSoop :neocat_floof_explode:

@yildo @lynnesbian one should more often than not keep inspirations like this to themself

amyipdev

@lynnesbian@fedi.lynnesbian.space considering the effects of going over 256, I'd assume this was not written by anyone remotely technical

Ysegrim

@lynnesbian For the same reason, trains in Germany are limited to 252 axles (safety margin to 256)

Emanuele Panz

@lynnesbian thanks for sharing! I remember @Girgias mentioning that at the #phpday2024 few months ago too!

zxm

@lynnesbian crikey, what sort of 8-bit operation are they running there? :-P

F4GRX Sébastien

@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.

Eli the Bearded

@lynnesbian

Be right back, increasing the train to 512 axles.

F4GRX Sébastien

@lynnesbian we've done that at work
"it does not work"
"dont do it, we just call it unsupported"

Σ(i³) = (Σi)²

@lynnesbian

"256 axles ought to be enough for everybody"
-- Bill Gates, probably

RS, Author, Novelist

@lynnesbian
I'm sure zero axles would trigger it, too. But regular rails don't support maglev.

Julia Clement :verified:

@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)

Ashley Rolfmore (leymoo)

@lynnesbian this is exactly what the uk government did about people naming companies with code injection attempts.

Greg Harvey 🌍

@lynnesbian /me imagines international terrorists taking notes... "If we could just......." 🤔

😂

Will Deakin

@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

InsertUser

@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.

Will Deakin

@InsertUser @lynnesbian top snark but misses the point. This is a technical point about the timetable not about the operation of the timetable.

Will Deakin

@InsertUser @lynnesbian it's a shame that with your erudition you are unable to resist the urge to share your obvious wit with others

InsertUser

@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.

mapto

@lynnesbian hm, begging for a train with 512 alxes.

boxcarbertha

@lynnesbian Don‘t fix Your bugs! Avoid them! 🤪

Julian

@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.

Joost

@lynnesbian my whole idea about Switzerland has changed now, prejudice it was, but still... #swissprecision

Go Up