10 ms·
Trains in Switzerland are not allowed to have 256 axles
- jt2190 7y agoTo save you the click through: > This may be a great obscure fact, but it is not an example of European regulations gone mad. To keep track of where all the trains are on the Swiss rail network, there are detectors positioned around the rails. They are simple detectors that are activated when a wheel goes over a rail, and they count how many wheels there are to provide some basic information about the train which has just passed. Unfortunately, they keep track of the number of wheels using an 8-digit binary number, and when that number reaches 11111111 it rolls over to 00000000. Any trains which bring the count back to exactly zero move around undetected, as phantom trains. From: "Humble Pi: A comedy of maths errors" by Matt Parker (https://mathsgear.co.uk/collections/books/products/humble-pi-a-comedy-of-maths-errors https://mathsgear.co.uk/collections/books/products/humble-pi...), page 191. edit: Added quote attribution.
- balabaster 7y agoSo if you want to move around Switzerland undetected, commission a train with 256 axles and bam! You're invisible :P
- ryanmarsh 7y agoI want to see the Snowpiercer / Speed reboot based on this concept.
- scarejunba 7y agoHaha one can imagine this will be rapidly bred out of the species since it's such a significant maladaptation. Like dressing in Vantablack and running on a rural expressway.
- kijin 7y agoTo catch intruders dressed in Vantablack, you'll need one of those devices they use to find exoplanets.
- H8crilA 7y agoOr, you know, infrared cameras :)
- TeMPOraL 7y agoOr just more light, and focus on shooting the dark spots.
- MagnumOpus 7y agoOr just _more_ light, and you don’t need to shoot because everything vantablack will be aflame...
- TeMPOraL 7y agoWhat if we tried more power? https://what-if.xkcd.com/13/ https://what-if.xkcd.com/13/
- mannykannot 7y ago"There have been plenty of times where a hardware issue has been covered by a software fix, but only in Switzerland have I seen a bug fixed with a bureaucracy patch." That's an amusing perspective, but it actually looks like it might be a hardware issue that cannot be patched purely with software, as it arises in the trackside devices that detect passing trains. I hope the method for verifying compliance with this rule does not suffer from the same problem (it may be moot: a train of 64 20 meter wagons would approach 1.5 km in length; not unusual in some places, but perhaps not Europe.) It is a bit of a stretch, but Boeing's MCAS problem might be also classed as a software issue 'fixed' with a bureaucracy patch, as the failure to make use of the available hardware to make the MCAS software fault-tolerant was 'patched' with an FAR directing pilots to the existing trim runaway procedure.
- lonelappde 7y agoIt's also a silly quote because people workaround broken software all the time.
- TeMPOraL 7y agoAnd if you see bureaucracy as software, it's full of bugs and processes that work around those bugs.
- sseth 7y agoBureaucracy fixing software issues is quite common. One story i have heard is that in the early days of railway reservation computerization in India, there were storage issues on the servers. The solution : cut the advance booking time from 90 days to 45, where it stayed for many years.
- Aloha 7y agoThis seems like a perfectly reasonably limitation in the context of european railroading (shorter trains, more frequency), when you consider that many European freight cars are 2 axle
- jonp888 7y agoYes, generally freight trains are not allowed to be longer than 740m, because there would be few sidings or loops long enough to put them in. So in practice the axle limit is unlikely to be the actual limiting factor.
- bob1029 7y agoIs 256 the upper limit, or is it just a magic number to be avoided? Is a train with 258 axles OK?
- ceejayoz 7y agoIf you click through, 256 overflows to zero, which means the system thinks there's no train. 258 is fine. > "Any trains which bring the count back to exactly zero move around undetected, as phantom trains."
- GlitchMr 7y agoThe law says "equal to 256", so the higher numbers should be fine.
- emerongi 7y agoShouldn't it be "multiple of 256"? Maybe nobody does >=512 axle trains.
- parsimo2010 7y agoA train with 258 would appear to be a train with 258 mod 256 = 2 axles. The purpose of the counters isn't really to count how big the trains are, just to keep track of them. So it at least knows there is a train on the tracks.
- jotm 7y agoA train with 258 axles counts as a handcar: https://en.m.wikipedia.org/wiki/Handcar https://en.m.wikipedia.org/wiki/Handcar :D
- anticensor 7y agoEven worse, 260 axles and you are still considered "light" engine (light engine is a term of art which means locomotive moving on its own power without hauling anything else).
- esotericn 7y agoShouldn't they also not have anywhere around 256, because if a 258 axle train has a couple of missed detections it'll still look like 0?
- SilasX 7y agoFrom the previous thread, some countries specific a little below 256 for a margin of safety: https://news.ycombinator.com/item?id=12071686 https://news.ycombinator.com/item?id=12071686
- davidkuhta 7y agoTIL: Per the article, this 256 limitation also applies to number of users in WhatsApp conversations and the maximum block height of a Minecraft world.
- soared 7y agoAlso reminds me of the maximum amount of coins you can have in runescape: 2.147B. They even created silver coins worth 1000 normal coins as a workaround for people who get to a “max cash stack”. (Max value in java, even though the game is non longer written in Java)
- stickfigure 7y agoThe language is irrelevant; this is the maximum value of a 32-bit signed integer. Specifically, 2,147,483,647. Java (and other languages) have other ways of representing numbers which allow larger values, but once you've encoded values into wire protocols and persistent data structures, they tend to be hard to change.
- mrspatula 7y agoI think OSRS is still all Java, no?
- anonu 7y agoI understand why an 8 bit number would be used for counting... But that limitation makes no sense for WhatsApp user limit count. Presumably every user has an id number identifying them (maybe a long integer). You need to maintain a list of these users so your array is already way larger than 8 bits. Can someone intuit why the 256 limit in WhatsApp?
- fsh 7y agoThis section is not present in the 2015 or 2016 edition of the rulebook: https://www.bav.admin.ch/bav/de/home/rechtliches/rechtsgrundlagen-vorschriften/fdv-2016.html https://www.bav.admin.ch/bav/de/home/rechtliches/rechtsgrund... Seems like overflow detection (or more bits) were added to the counters at some point.
- kposehn 7y agoYep. They routinely run fairly long trains over the Lotschberg and Gotthard lines through the base tunnels that I’m pretty certain are approaching 256 axles, but I have yet to see any with more. Most likely the main transalpine lines now allows >256 axles while other secondary lines have not been upgraded.
- SkyPuncher 7y agoTrains longer than 256 aren't the issue as the numbers roll over. The problem is trains with exactly 256 axles (or a multiple of 256), they're seen as zero.
- dTal 7y agoNot an expert, but I imagine it could still cause some routing problems if a 258-axle train were mis-registered as a 2-axle train; the latter takes up dramatically more space on the network.
- dwild 7y agoConsidering that a train can require 2 km to break, I'm sure they keep enough space between trains that there's plenty of space for both 258 or 2 axles trains. Knowing a train is there seems much more important than its lengths (up until they decide that 2 axles trains can be much closer to another trains).
- vilhelm_s 7y agoI'm waiting for the freak accident when a 200-axle train enters a given segment, and then later a 56-axle train accidentally ignores a red light, and plop the segment is now marked as all-clear again.
- m0xte 7y agoOr a 200 axle one breaks somewhere and 56 axles roll back over the sensor.
- majewsky 7y agoYou cannot "accidentally" ignore a red light. Driving over one will trigger an emergency stop unless you specifically disable this mechanism.
- RugnirViking 7y agoallowing for not just two but three trains in a given section... wow!
- parsimo2010 7y agoIn similar news, popular athletic app Strava has announced that they will be dropping Bluetooth support because of an issue with their code. https://support.strava.com/hc/en-us/articles/360032979131-Removing-Direct-Sensor-Pairing-from-the-Strava-Mobile-App https://support.strava.com/hc/en-us/articles/360032979131-Re... Strava aren't fixing the bugs, just dropping the feature altogether. They even admit that other athletic apps implement Bluetooth without bugs, so it's not a platform limitation. So sometimes people decide that an easy fix is a better choice than a "correct" fix, which would be either adding bits to the train axle counter, or implementing a way that didn't care how many axles there were- such as having a head and tail indicator for a train, and not counting the axles in between.
- lonelappde 7y agoThey obviously have a head and tail indicator already, so they don't merge all the trains together. The issue is that they overload the axle mod 256 counter with the train indicator, instead of using a separate byte.
- thih9 7y agoLooks like this leaves the issue of 256 multiples unresolved. In theory we could still have a 512 axle ghost train.
- city41 7y agoYou can carry a maximum of 255 rupees in the original Legend of Zelda, and back in the day magazines commented on the "oddly specific" number.
- Bayart 7y agoThat reminds me back when WoW was still 32 bits and people discovered the gold cap was 2 147 483 647 copper coins.
- reificator 7y agoSo your gold value was signed? Does WoW allow for debt by tracking negative values, or was it just an oversight?
- saalweachter 7y agoSome people just really, really dislike unsigned ints.
- Gibbon1 7y agoI've run into programmers that think something terrible is going to happen if you use an unsigned int for anything.
- perl4ever 7y agoIs there a popular language these days that throws an exception whenever an unsigned int overflows?
- vertex-four 7y agoRust in debug mode or with a compiler option will panic if a number overflows.
- 7y ago
- dmit 7y agoPreviously: https://news.ycombinator.com/item?id=12071240 https://news.ycombinator.com/item?id=12071240
- chiph 7y agoI'm not sure why they're even counting past 2 (the minimum number of axles to indicate a railcar is present, at least until someone delivers self-balancing single-axle railcars) for train detection. Unless it's to estimate track wear, or for revenue collection?
- makomk 7y agoTrains are typically made up of multiple carriages. The axle counters ensure that all the carriages which enter a section of track leave that section of track, and that none have detached and been left behind for the next train to run into.
- war1025 7y agoTo elaborate on this, I think what is going on is a section has a "counter-upper" on one side, and a "counter-downer" on the other side. So while the train is within that segment, the value of the counter is non-zero. Once they exit, all the axles should get counted again in the opposite direction and reset the count to zero. The problem with 256 is that the count would be at zero while you were in the track segment.
- jcranmer 7y agoOne of the primary uses of these kinds of devices is in lieu of track circuits: for a given rail block, they count the number of axles currently present by subtracting the number of axles that exited from the number that exited. Another use is to detect trains that have a failed coupling, disconnecting several cars which no longer have a powered locomotive attached to them to move them.
- jefftk 7y agoIf the law prohibits 256 axles, it should really prohibit any multiple of 256. A 512-axle train would similarly be erroneously detected as having zero axles.
- Freak_NL 7y agoThat would be a freight train consisting of 128 units. Not likely in Europe, where the average freight train has 25 to 30 wagons, and the longest freight train seems to measure 835m, which will put you in the neighbourhood of 40 units. I'm not even sure that one would fit on the Swiss network; it runs or ran between Hamburg and Denmark, a route which features not quite as many elevation differences and tunnels. Considering this, the chances of even hitting the lower 256 axle mark are probably negligibly remote as well.
- jefftk 7y agohttps://en.wikipedia.org/wiki/Longest_trains https://en.wikipedia.org/wiki/Longest_trains gives 180 cars for the US, and longer for Australia, Brazil, and others. Cars can also have more than four axles; at the extreme you have https://en.wikipedia.org/wiki/Schnabel_car https://en.wikipedia.org/wiki/Schnabel_car But yes, this is probably not an issue in Europe.
- viburnum 7y agoThere was something posted on HN years ago about a mainframe that ran the French railway pension system. There was something funny about different pay rates for rates going uphill or downhill, whether the engineer was a military veteran, etc. Does anyone have a link? I can’t find it now. Thanks.
- lordnacho 7y agoThe thing is Switzerland is also the only country where I could imagine someone might know such a rule. Say you are working on connecting some trains, and you happen to be one car away from 256 axles. Well, if the org you're working for is SBB/CFF/FFS I could totally imagine the foreman saying "oh wait, there's a rule about this". Any other country, no way. From personal experience people there seem to follow the rules very meticulously.
- Razengan 7y agoI would wager that they might be as meticulous in Japan too.
- wincy 7y agoI’m glad I read an article on HN about pointing and calling[0] in the Japanese rail system as a way of preventing accidents. I take a blood pressure medication and had once or twice taken it a second time in the day, which wiped me out and made it VERY difficult to work (for the record, I don’t take it for blood pressure and it’s a very low dose, so I wasn’t at risk of my heart stopping, just very sleepy). Now I do a specific gesture, point and call out that I’m taking my pill. I haven’t accidentally taken a second one since because it makes taking my pills so much more memorable. https://en.m.wikipedia.org/wiki/Pointing_and_calling https://en.m.wikipedia.org/wiki/Pointing_and_calling
- spdustin 7y agoThey should do what the Norwegian Navy does, and put barcodes on the cars. Why does Norway do it? When their ships pull into home port, they Scandinavian. ;)
- a3n 7y agoWah -- wah -- waaahhh.
- adrianmonk 7y agoThe "fixed with bureaucracy" thing is entertaining, but it's probably a delusion that the fix is effective. For one thing, this rule is not intuitive and people aren't likely to remember it. People have an easier time remembering and following rules whose reasoning clicks with them. It's not a recipe for success to say, "Oh, there's this one weird thing that you can't do, and it isn't going to make sense to you why, but remember not to do it." I also wonder whether, even if someone in the industry does know the rule and really wants to follow it, there's an easy method to know whether their train has 256 axles. Is there a procedure in which axles are counted or an automated system that does it? If it's a manual procedure, is it time-consuming and is there pressure to skip that step when you're in a rush? And, if a fallible human being should make a mistake and run a train with 256 axles, is there any protection against the phantom, undetected train scenario, or is it a silent failure?
- hkai 7y agoWhat if Swiss trains consist of 30-40 cars at most? Then the rule is purely technical and doesn't even have to be remembered.
- adrianmonk 7y agoVery fair point. As long as that condition holds, then I guess it's a non-issue. There are apparently trains bigger than that in some parts of the world (such as the US and Australia) but maybe conditions in Switzerland prevent that from happening? This is way beyond my level of knowledge though.
- kposehn 7y agoActually, the longest regular Swiss trains seem to top out at 44 cars. This is because of passing siding lengths being much smaller than other countries such as the US. There are longer trains that are scheduled on routes with longer sidings however such as a the main north/south routes. Most European trains rarely exceed 22 cars for the same reasons as they have to be able to be passed by express trains in stations.
- 7y ago
- m0zg 7y agoThat's nothing. Signed overflow in C/C++ is _undefined behavior_. Which means there's no guarantee that you'll get anything recognizable out of it. :-)
- ohazi 7y agoBut unsigned overflow is defined. Are we expecting a negative number of axles?
- m0zg 7y agoThe train counter isn't even software based. I just wanted to point out the example of a much more common issue that most programmers aren't aware of. Very few languages catch unsigned integer overflow as well. The only popular one I can name is Swift.
- robocat 7y agoWhich also presumes axle-counters are perfect... I'm surprised they didn't also ban 255 and 257!
- Grue3 7y agoBut did you know an Oyster card in London can't have more than 16 fare zones? This is the reason why some stations on Overground don't accept Oyster cards.