7 ms·
Wow, a simple bit-arithmetic bug somewhere in there has over time become a design constraint for all trains used in an entire country. That's insane!
by cs702 10y ago
Wow, a simple bit-arithmetic bug somewhere in there has over time become a design constraint for all trains used in an entire country. That's insane!
- jacquesm 10y agoMore of an operational constraint. You can design the various carriages and locomotives any way you want as long as you don't compose them in that way. They're putting an awful lot of faith in that counter though if they allow 255 and 257 that means that they expect to never miscount an axle.
- adrianN 10y agoA single wagon probably has an even number of axles, so 255 and 257 is probably impossible. But yes, those axle counters are extremely reliable, a miscount produces quite a bit of work because then a human has to confirm that the train left the track protected by the counters.
- masklinn 10y ago> A single wagon probably has an even number of axles Do bogies with uneven number of axles even exist?
- rocky1138 10y ago> A single wagon probably has an even number of axles, so 255 and 257 is probably impossible. Voilà.
- tlrobinson 10y agoThat doesn't seem like a safe assumption: http://d2ydh70d4b5xgv.cloudfront.net/images/a/e/fleischmann-3-axle-baggage-coach-5894-ho-scale-train-car-model-mib-dba8cb993304cdd963b7f2d9df8ebe48.jpg http://d2ydh70d4b5xgv.cloudfront.net/images/a/e/fleischmann-... (Not Swiss, just the first train car I could find with 3 axels)
- rmoriz 10y agoThis German car is like 100 years old and was scraped years before they managed to implement axle counters.
- rob74 10y agoThat car may be 100 years old, but the last German three-axle cars were build in 1959 (https://de.wikipedia.org/wiki/Umbau-Wagen_(DB)#Dreiachsige_Umbauwagen.2C_Gattung_3yg https://de.wikipedia.org/wiki/Umbau-Wagen_(DB)#Dreiachsige_U...), and some of them were still in use in 2014 (https://de.wikipedia.org/wiki/Datei:Umbauwagen_der_DB_Bahnbau.jpg. https://de.wikipedia.org/wiki/Datei:Umbauwagen_der_DB_Bahnba...)
- rmoriz 10y agoNone of them are in regular use anymore and also you can't build a long enough train to exceed the limit.
- masklinn 10y ago> you can't build a long enough train to exceed the limit. You can definitely build long enough trains to blow past the limit several times, coal and ore trains are routinely 100+ cars long (with each car having at least 4 axles), the record is a BHP Billiton Iron Ore train of 682 cars and 8 locomotives.
- jacquesm 10y agoI remember being stuck on a crossing with an ore train like that passing. It was going quite slow and it took forever to pass. 100's of cars.
- pfortuny 10y agoTalgo trains have just one axle per wagon... See https://en.wikipedia.org/wiki/Talgo https://en.wikipedia.org/wiki/Talgo
- camiller 10y ago257 would be impossible regardless 1,2,3,...,254,255,0,1,2,3... 1 byte. Although it is mentioned in the comments to the linked article that it is probably an electro-mechanical counter, so I am imagining a four wheel encoder with each wheel having 4 positions (although could be 8 wheels with 2 positions per wheel), electrically readable, and reset-able.
- jacquesm 10y agoTrains can be composed of all kinds of cars.
- camiller 10y agoyeah, but my point was that a mechanical counter of this nature would overflow counting 0-255 then wrapping around. So it would never get to 257. And the wheels I was referring would be in the counting mechanisim, I didn't say anything to suggest type of cars / axles etc.
- jacquesm 10y agoNo, that it won't get to 257 is the whole point here. So 257 axles with a single axle missed would end up as 256, resetting the counter -> no train present. Ditto for 255 with a single 'bounce'.
- camiller 10y agoI don't think that the article was about miscounts, otherwise it would equally be a problem for a 258 axle train that missed 2 axles. Since the article is describing a problem that occurs for multiples of 256 it is almost certainly a counter overflow issue, so a 256 axle train resets to zero and a 257 axle train would appear to the counter as 1, which is still sufficient to mark the block of track as occupied.
- jcranmer 10y agoThe standard locomotive arrangement in the US is 2 bogies of 3 axles each; 4-6-0 and 0-6-0 wheel arrangements (5 and 3 axles, resp.) on steam locomotives were also common. While the modern locomotives do have an even number of axles, it's not a multiple of 4 (like standard wagons usually are), so it's not possible to have 256 axles exactly if you have an odd number of locomotives (e.g., 2 forward/1 reverse arrangement).
- innocenat 10y agoDon't forget multiple units. Those usually have axles in multiple of 4
- rmoriz 10y agoAxle counters are "positive only" systems e.g. if the numbers don't match or the counter resets, it will report an error and the next train needs a special safety order to enter the track section. So if you manage to combine a 256 axle train, it will just slow down everything on its way and cause chaos, but no accidents. In the old times there was a manned caboose car at the end which job was to ensure the completeness of the train (and that switches are cleared). Here's an example of such an SBB car decommissioned some centuries ago http://www.bahnbilder.de/bilder/gueterwagen-266906.jpg http://www.bahnbilder.de/bilder/gueterwagen-266906.jpg Video (1986) https://www.youtube.com/watch?v=ev4szZ4iNTY https://www.youtube.com/watch?v=ev4szZ4iNTY
- tvmalsv 10y agoYa, I remember those. My friends and I would always wave to the cabooseman (I doubt that's the right word, but I really like it) as it went by, and he would usually wave back at us.
- Symbiote 10y agoIn Britain, he'd be called a guard or brake-man, and rode in the brake van. The US probably has a different term.
- waqf 10y agoIronic since "van" means the front, as in vanguard.
- morsch 10y agoI realize you weren't being serious, but this van is an abbreviation of caravan, which ultimately has its origins in Persian: In 16th cent. carouan, < Persian kārwān, in same sense. Found in medieval Latin carvana (Hoveden), caravanna, caravenna (Matt. Paris), and French carvane, from Crusading times, but apparently not in English before 16th cent. The form caravan was perhaps caravane from French.[1] [1] http://www.oed.com/view/Entry/27717#eid10166797 http://www.oed.com/view/Entry/27717#eid10166797
- masklinn 10y agoA train having less than 256 axles in Switzerland doesn't exactly sound limiting, ridiculously long trains are coal and ore lines (e.g. BHP Billiton) or huge general freight in large countries (Canada, US). Switzerland is a fairly small country with steep gradients, a 256 axles limit would give a limit of ~60 cars.
- kozak 10y agoThey don't say that this is an upper limit. The number should not _equal_ 256 (or 512, etc), but it can be larger or smaller than that.
- masklinn 10y ago> They don't say that this is an upper limit. It's not, but considering the context going above would mean going through the limit which would be dangerous, during exit the counter would mark a railroad section as unoccupied before underflowing back to occupied. It might also have interesting failure modes during entry.
- tveita 10y agoIt sounds like that would momentarily register the track as free between the 256th and the 257th axle, a nice little race condition.
- shawabawa3 10y agoIt's not that it has to have less than 256 axles, it has to not have exactly 256 axles (or presumably multiples of 256)
- superuser2 10y agoThis kind of thing makes me less apprehensive about programming jobs going away. The quality of the software the world depends on is so low. We can do so much better and hopefully better will be demanded of us as the field matures.
- camiller 10y agoWhy would you jump to the conclusion that this is a software implementation. I believe, based on the comments in the linked article that it is probably a electro-mechanical counter.
- deleted 10y ago[deleted]
- morsch 10y agoThe problem may not be software, the solution almost certainly will be.
- mywittyname 10y agoThis was likely a known limitation when it was implemented and the costs to overcome it weren't considered worth it.