Do you know how to create a local branch that tracks a gerrit commit? Usually I just do git commit --amend to update gerrit, but then I lose access to my patch's history (it's still on gerrit, but I want it locally).
The article is hard to follow for me, but if I understood it correctly, this is not true:
> That is just not going to happen in (classical) reality, though. Because once you properly set the initial state of the ball (force=velocity=0, or any other values), then the solution becomes unique
If you set velocity = velocity = 0, then the ball staying at the top is a valid solution, AND the ball rolling down the hill (in any direction) is also a valid solution.
If this sounds confusing (it did for me), look at the example at the end, it's possible to do the reverse - send the ball rolling up the hill with perfect velocity, such that it stops at the very top after time T. And if that is possible, the opposite is also possible because NM is time reversible.
> The article is hard to follow for me, but if I understood it correctly, this is not true
You are right, I was missing some conditions. The higher order derivatives need to be zero as well.
> If you set velocity = velocity = 0, then the ball staying at the top is a valid solution, AND the ball rolling down the hill (in any direction) is also a valid solution.
It is a valid solution to the f=ma equation. It is not a valid trajectory in Newtonian physics because it violates other principles. It is a “gotcha” only if you think that Newton’s second law is the entirety of classical mechanics.
> If this sounds confusing (it did for me), look at the example at the end, it's possible to do the reverse - send the ball rolling up the hill with perfect velocity, such that it stops at the very top after time T.
This paragraph is confusing. And does not demonstrate much of anything, instead asserting facts that we are supposed to believe.
In the time-reversal “experiment”, where the particle comes from the rim towards the apex, it ends up at the apex with a non-zero fourth derivative, because of the pathological shape of the dome. It cannot stay on the apex for any length of time, even with a velocity of 0. It is completely different from a particle starting at rest on the apex.
> And if that is possible, the opposite is also possible because NM is time reversible.
> It is a valid solution to the f=ma equation. It is not a valid trajectory in Newtonian physics because it violates other principles. It is a “gotcha” only if you think that Newton’s second law is the entirety of classical mechanics
Could you please elaborate which Newtonian principles it does violate?
The simplest one is that a particle on its own keeps a linear trajectory with a constant speed. A change in that (like going from rest to any motion) requires interacting with another particle: things do not start moving for no reason. This is a generalisation of one of the formulations of Newton’s first law, which states that things that don’t move don’t start moving without being pushed (rough translation).
This is related to another formulation of Newton’s first law: if there is a force that pushes the ball at some time T, it implies that there is another body that felt the opposite force.
Another one is a bit more involved, but basically a mechanical system cannot change its symmetry by itself. In this case, the initial state with a ball at rest has a radial symmetry with a centre on the apex of the dome. This is not true anymore if the ball moves in one direction. This is related to the conservation of momentum.
There are a couple of points that can be solved easily, but are clearly defects in the original formulation of the problem. for example, the height according to the equations is not a length, which is not a problem itself (we can just multiply by an arbitrary factor with the right dimensions) but an indication of sloppy thinking and hand waving. Similarly, the force is not bounded in the original formulation. Again, this can be fixed by restricting the valid range for r, but is rather messy.
Theres a couple of mistakes here. Firstly the particle is not on its own, it is being acted on by the dome and by gravity.
The thing about symmetry breaking also doesn't make much sense. I guess you're trying to appeal to Noether's theorem, but Noether's theorem in classical mechanics is a consequence of f = ma. You derive the Lagrangian formulation of mechanics from f=ma and Noether's theorem from that. However the weird solution when then ball suddenly randomly falls down the dome after staying put for an arbitrary time is completely consistent with f=ma, so that can't help you here.
In any case the radial symmetry you're looking for (the system is invariant under rotations around the peak of the dome) implies conservation of angular momentum about this point, and not about any other point (since the setup is manifestly not symmetric under rotations about any other point). However (one can easily check) that for both the static solution and the randomly starts moving solution, the angler momentum about the axis through the peak of the dome is always zero.
The particle does not undergo any net force while at rest. If you understand "acted upon" to be a causal statement, then no, the particle should not be able to leave a resting position, because when it is at rest there is no net force acting upon it.
The argument is basically assuming that the particle moves, showing that it moves in a way that respects the second law, then restating the first law to be a special case of the second to avoid the causal language it contains and to make it completely redundant.
There is no time when the particle is accelerating, or even moving, while not experiencing a net force in this setup. The argument you'd have to make would be to change Newtonian mechanics so the first law is no longer a special case of the second law, but actually says something nontrivial about all of the time-derivatives of position rather than just the first two. This (in my opinion) would no longer be Newtonian mechanics, but some extention.
Even then I'm not sure that would save you in general, since it should be possible to cook up examples where the motion is some non-analytic thing like a portion of a "bump function".
Edit: by the way, a more modern formulation of the first law is essentially that there are no privileged inertial frames. All inertial frames are equally valid. This is straight-up false in this setup since obviously the rest frame of the dome is privileged (since the dome is given infinite inertial mass).
> There is no time when the particle is accelerating, or even moving, while not experiencing a net force in this setup.
I agree! But at the same time, there is no moment at which a net force compels the particle to leave a state of rest. The criteria you are putting forwards with that sentence isn't that of the first law, it's just a consequence of the second law. The first law makes a statement that force is required to cause a body to leave a state of rest, but that's not what we have here.
We just postulate that it must stop being at rest immediately after T, and then we find a force as a result of it not being at rest anymore. This inverts the causality that NFL requires, and because it doesn't have give a cause for the particle to leave the state of rest, which the 1st law requires, it's not a valid physical solution in Newtonian mechanics.
Here is Wikipedia's translation of the first law, which is as good as any:
> Every body continues in its state of rest, or of uniform motion in a straight line, unless it is compelled to change that state by forces impressed upon it.
In our trajectory, the body is not compelled to change its state by a force impressed on it. It's in a stable state, then we arbitrarily decide that it will change it's state immediately after T, and then we show that this leads to a trajectory which satisfies the second law. But since it changes state without being compelled by a force, it's no longer a trajectory which satisfies the first law.
> The argument you'd have to make would be to change Newtonian mechanics so the first law is no longer a special case of the second law
I'm not changing Newtonian mechanics - Newton's first law is not a special case of the second law. It makes a statement about cause and effect. The second law doesn't - it's just a differential equation, which does not have such a content. The article redefines the first law to strip it of its causal content and instead make it a trivial statement, but that's not what the first law plainly states. In Newtonian physics, force is necessary to cause a change in velocity, it's not simply that force and acceleration co-occur.
> but actually says something nontrivial about all of the time-derivatives of position rather than just the first two
No, this isn't necessary. If you want, you can instead understand it as something about the nth derivative of position, and that way you can recover perfect reversibility, but you don't have to. You can just keep Newtonian mechanics as is, and recognize that they describe a causal system, and not just a system of differential equations (which make no statements about causation in and of themselves), but then you lose perfect reversibility for some pathological trajectories like this one.
> Even then I'm not sure that would save you in general, since it should be possible to cook up examples where the motion is some non-analytic thing like a portion of a "bump function".
I'm not arguing for the infinite derivative modification either, but I don't see how that's the case - if you have a non-analytic function then some derivatives don't exist, and if they don't exist then they wouldn't be able to satisfy the infinite derivative formulation. Seems to me that such a law would directly eliminate all non-analytic trajectories.
This is not correct. Momentum is conserved by the spurious solution and there's still an equal but opposite force on another body (the body producing the gravitational force).
I think this example just illustrates a case where the Newtonian model of reality simply does not describe reality itself
Even if it does, that would amount to a contradiction in Newtonian mechanics. You don't get to simply ignore that the ball starting to roll after arbitrary (non deterministic) time T is a solution to these equations.
(Note that the article goes on at length separating Newtonian mechanics from the "real world" or whatever)
> If you set velocity = velocity = 0, then the ball staying at the top is a valid solution, AND the ball rolling down the hill (in any direction) is also a valid solution.
Yes, that is exactly right. Not only in any direction, but beginning at any time.
The easiest way to see this is described at the end: imagine the ball is initially in motion and the initial conditions are precisely those that bring it precisely to rest at the apex of the dome at some time T. (Making this possible is the reason the dome has to be a specific shape. Not all shapes allow this.) The time-reversal of this motion is the ball beginning to move in some arbitrary direction at some arbitrary time.
> The easiest way to see this is described at the end: imagine the ball is initially in motion and the initial conditions are precisely those that bring it precisely to rest at the apex of the dome at some time T.
This is a red herring. It sounds plausible, but there is no trajectory that does this. This is the weakest paragraph in the original post, and I am not sure whether this is intentional (because the demonstration sounds truthy if you don’t go too deep in the details) or whether it was not entirely thought out. There is some discussion about the time-reversal thing here: https://blog.gruffdavies.com/2017/12/24/newtonian-physics-is... . There isn’t much to discuss however, because ultimately it is just a distraction.
There's a lot of minor points in that post, but it seems like both authors largely agree on the meaning, but are using different language. From Dr. Davies' post:
>To remain Newtonian and preserve determinism, we can exclude the singular point by constraining the higher orders to zero whenever the net force is zero. We lose time symmetry for this special case if we do this. If we wish to keep that, then we have to accept that Newtonian mechanics is incomplete and consider higher order differentials.
And from Dr. Norton's article:
>The solutions (3) are fully in accord with Newtonian mechanics in that they satisfy Newton's requirement that the net applied force equals mass x acceleration at all times.
>An important feature of Newtonian mechanics is that it is time reversible, or at least that the dynamics of gravitational systems invoked here are time reversible.
Dr. Davies is saying that there's three options: a) relaxing time-reversal symmetry (at singularities) from Newtonian mechanics, by interpreting Newton's First Law to apply to higher derivatives; b) considering Newtonian mechanics to be incomplete, and make (unspecified) choices about what trajectories of higher-order derivatives are acceptable; or c) accept non-determinism.
Dr. Norton is defining "Newtonian mechanics" as necessarily having time-reversal symmetry, which prevents the first solution. He is also defining it as specifying acceleration only (which I think is quite reasonable), preventing the second solution. Therefore he's concluded the third solution: This mathematical stating of Newtonian mechanics is non-deterministic.
You are entirely right, whether something that depends on higher-order derivatives can be called Newtonian is debatable. Personally I don’t really care either way, as this is just a label. Newton did not mention higher-order derivatives but on the other hand they are a trivial extension to the mathematical framework. It is difficult to call a body at rest if any of the derivatives of the position is not zero, because then it will start moving instantaneously so it is hard to read the first law otherwise. And the second law does not care about anything other than acceleration. And there certainly isn’t anything that prevents us from using clever shape to roll balls on, as long as the shape make physical sense.
What this does not change, however, is that the dome does not demonstrate non-determinism. The apparent demonstration hinges on logical errors that remain errors regardless of the framework used, be it classical or quantum mechanics, or relativity.
If you throw a ball into a bowl, it will also find the (anti-)apex. And the time-reversal of that is the ball arbitrarily choosing a direction to jump off the center of the bowl. So what? Why is it important to mention in case of a non-stable equilibrium?
> The "ball rolling to the top of the sphere" requires infinite time.
No it doesn't, because it's not a sphere. The dome is specifically designed so that it takes finite time. There's zero involvement of infinity, or mixing infinity, here.
I don't know what kind of answer you're looking for. The equation was explicitly chosen/derived to have this property. I assume the mathematical proof of that isn't something that fits in a few sentences in an HN comment.
Back when I was a little smithling who knew more math than physics, I complained about an assignment whose solution didn't make mathematical sense. My teacher commented that I needed to think like a physicist, that is, understand that certain mathematical issues didn't exist in the real world, so could be ignored.
That doesn't mean that if it's invertable it's in physics.
Are the inverse dynamics of this system still in Newtonian physics? For example, is is the inverse path actually on the described surface or does it detach? How does a moving mass have an instantaneous jerk with no change in velocity?
The article explicitly discusses the fact that this is possible specifically because of the shape of the dome, and does not work on a hemisphere, precisely for reason you bring up.
The next step would be to verify that the paths always stay on the surface. The mathematics shown says the point always follows the surface, but I don't see a demonstration that that's true.
I no longer have the skills to easily do this calculation.
EDIT: Oh man, I used to be a lot better at this. I remember the mgh = 1/2 m v^2 and the slope calculation, but can't figure out how tell when the falling point mass detaches from the slope. If it detaches at h=0 then there's no physically viable reversed path on the surface.
There's a common way people from scientific communities (such as HN) look at the world - there's a "real world" out there, and in order to improve our understanding of things we should approximate (discover the rules that govern) this real world and try to minimize our subjective experiences as much as possible. I fully subscribe to this view, the real world has to be same for everyone, right?
But there's another way to look at things which is prevalent in other circles, and if someday you decide to learn to meditate, I'm confident you'll get it.
How do you know the "real world" exists? Maybe you're a brain inside a jar "in the machine", and all the things you experience are being generated by the machine. In that case, how is an hallucination any different from any other experience you have? It isn't, it's exactly the same, it's just another experience. How you interpret it may be different, if you realize it's an hallucination, but the process itself is the same.
When you look at a tree, you can't just see the tree, you can only see the model that your mind creates of that tree, from the light that reaches your eyes, the sound, maybe touch etc - this is true for everything you experience.
Obviously the first perspective is very useful, it's science. But the second perspective is also very very useful, if you want to know why I can elaborate : )
If you like this, do yourself a favor and go watch the entire Human Behavioral Biology course from Standford, it's also taught by Sapolsky: https://www.youtube.com/watch?v=NNnIGh9g6fA
What I think makes the course so good is that it gives you a brief but solid introduction to many different fields:
I often bring up his lecture series as an shining example of how to explain scientific theories with a critical qualifier that almost always is otherwise missing.
He first explains a concept with logically and narrative consistency in order to explain why something occur. Then at the end he goes and demonstrate all the wholes in the theory and through that shine a light at where the narrative fails. It is only after going through multiple different competing theories that the edges start to get defined.
Cannot recommend this more! Seriously. It has been an eye opener to me. For people who loves books over video, he wrote those books where he covers the same topics:
- Behave: The Biology of Humans at Our Best and Worst
- Why Zebras Don't Get Ulcers: The Acclaimed Guide to Stress, Stress-Related Diseases, and Coping
I read "Behave" and IIRC it covers around 80-90% of the lectures, moreover on the book you will find a couple of appendixes to refresh the reader on the basics of Biology and Neurology to better understand certain sections. I think that the lectures are a bit more entertaining than the book, but I found it more easy to follow than the lessons.
Seconded. I've only watched the first five or so, but they are absolutely worth it. They changed a lot about how I think through certain situations and have proven their worth many times.
Great lectures. He even manages to cover chaos theory. Philosophy students should look into this series for some biology orientation, in my humble opinion.
The lectures are good, the LECTURER is galaxy class. Everyone regardless of discipline should watch the lectures for their metacognitive qualities alone.
Sapolsky could literally give a lecture on shit and I'd be at the bus stop, someone would mention just a sliver of a lead and I'd intergect with, "I just saw this amazing lecture on shit by Sapolsky ..." to a complete stranger.
Last time you used an higher level interpreted language (like JS), did you have to worry whether or not the machine instructions it was generating were the right ones? Generating instructions at runtime sounds pretty unsafe, no?
You didn't, right? You can just mostly assume the language works and get on with your life. That's how unsafe feels to me when I'm programming in Rust, I never have to worry about it and pretty much never need to use it.
Sometimes you'll run into a problem where you need to use unsafe, but that only happens very very rarely, for example when creating an interface to a C library, but most people will never need that. When that happens, sure, you'll have to be extra careful and make sure everything works. But after you're done with that small piece, you're back into safe Rust.
So, how does it work in practice, if you really need to use unsafe? Suppose you have a C enum with values MyEnum {A, B, C} (but it can be any int in C!), and you want to use it in Rust. You can make an unsafe wrapper that tries to parse the enum, and it can either return None - if it was an invalid integer, or return Some(A), Some(B), Some(C).
But once you get the wrapper right (which is not hard), Rust will guarantee that values of type MyEnum have values A, B or C and nothing else, so you never need to worry about the exceptional case again.
You worry about it once at the boundary and that's it.
Issues with ISRs are different. They'll sorta appear when rust is used inside the Linux kernel, too.
For example, can rust make sure some kind of function is not called at any level when called from certain kind of context (say atomic context).
Can rust help detect/prevent you from accessing some multi-register SFRs or memory locations from main context without making you disable interrupts first in the main context?
And this constraint is only relevant if the SFR or said memory location is ever accessed from some ISR, and the access is not atomic, otherwise disabling interrupts is not necessary.
Do you have to wrap all these accesses and keep track of all this manually just like in C or does rust have some concept of "colored" functions, so that you're forced to wrap accesses to certain memory locations only if these accesses are shared between differently colored functions.
I'm not a rust person either. Just wondering how rust would help me with the most complicated aspects of concurrency in low level programming. Allocating/deallocating memory and keeping track of it is easy compared to this.
What you want sounds similar to Rust's Mutex design pattern. In most languages, there's no link between a mutex and the resources it's protecting, but in the Rust standard library, a Mutex<T> contains the resources (the T), so that the only way to get access to these resources is to lock the mutex, and the borrow checker will not allow accessing them after the mutex is unlocked again.
In your case, you could implement something like an InterruptDisabler<T>, and use it to wrap an object which has the methods to access these registers. When you wanted to access these registers, you would do something like "my_interrupt_disabler.disable_interrupts()", which would disable interrupts and return an InterruptDisablerGuard<T>, which then would you to access the T. Once that InterruptDisablerGuard<T> gets out of scope, the compiler automatically calls the drop() method from the Drop trait on it, and that method could enable interrupts again. You cannot access the inner object without going through the guard, and you cannot get the guard without disabling interrupts.
And that's only one possible implementation. Another one would be to have something like an "interrupts disabled" token which is returned by a "disable interrupts" function, which is consumed (that is, destroyed) by an "enable interrupts" function, and which is !Send and !Sync (so it cannot be passed to another thread). The methods which access these registers would require you to give them a reference to the token, so they could only be called if you somehow obtained the token, which could only be done by disabling interrupts in the current thread. And for when you're within the interrupt handler itself, the low-level code which calls it could manufacture one of these tokens and pass a reference to it to the interrupt handler, so it would be able to access the registers without calling the "disable interrupts" function.
Of course, both of these ideas still require you to decide which registers are safe to call with interrupts enabled, and which registers are not, when creating the objects which represent the register blocks. Rust can help the developer, but it's not a panacea.
It's not about which registers are safe, but about whether the access patterns compiler generates for register access are safe. Say `andl some_sfr,#0xfe` is safe for all SFRs, but `mov r1,some_sfr ; andl r1,#0xfe ; mov some_sfr,r1` is not (not atomic, interrupt can happen in the middle).
Say `some_sfr = 1` is safe but `some_sfr = (some_sfr & 0xf0) | 0x3` is not.
Token thing seems interesting, but generally, no code calls the interrupt handler, HW does that by itself (outside of the control of the language), so there would be no way to pass the token to the handler, it would have to be manufactured in the handler out of thin air (without disabling interrupts, because those are disabled automatically by HW). And I'd have to wrap all the non-atomic language constructs in some functions that would require the token, to have some enforced safety.
I guess the fearless concurrency thing is only for cases where the language controls the creation of threads.
For everyone that enjoyed this, there's an entire free online MIT course called Performance Engineering of Software Systems[1] where you'll learn plenty more tricks and common pitfalls like these. You'll also learn how to use tools to debug the low level performance of your programs: looking at cache misses, cpu utilization, time spent per assembly operation and so on. It's pretty cool :)
Self-taught programmer with almost 3 years of experience. I started a Physics degree but left midway through to study programming and computer science, using formal online resources like MIT OpenCourseWare. I love Physics, Math, solving hard problems and learning new things.