-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong device reported missing #397
Comments
An example that still shows this problem now is |
I've traced this as far as seeing that the |
The example with |
Strangely both Hmm, breakthrough? Maybe it has to do with the fact that I can also trigger the bug with However, |
I think the problem has to do with the fact that in this code: Lines 1746 to 1752 in d62d8c5
I think this code Lines 1729 to 1734 in d62d8c5
is a bad idea: it creates an easy-to-get-wrong invariant that anything coming from that list must be kept in the same order and no duplicates dropped, since later it will get zipped with something. We should instead do the |
@byorgey the lines have shifted a bit it seems - if you use a link with specific commit GitHub should even show a preview. 😉 Lines 1600 to 1606 in 1930fe6
|
@xsebek Thanks! I knew about that but forgot when I made those links. Pro tip (tm) for anyone reading this later --- when viewing some code you can hit the |
Fixes #397. The only way I could understand this in order to fix it was to totally refactor the code and add lots of comments as I went. I feel like this is some of the most difficult code to wrap one's head around in the codebase. Hopefully now it's a bit easier to understand (though still not easy, I imagine).
Add a new `GPS receiver` device which enables the `senseloc` capability (and hence the `whereami` command). Towards #26 . - My immediate motivation is that I want to be able to define `excursion : cmd unit -> cmd unit` which executes the given command and then returns to the same location and orientation as before. Being able to use the `whereami` command is one of the last missing pieces of machinery necessary to be able to do this in classic mode (the other is a `heading` command, see #955). - The proposed recipe for `GPS receiver` is `antenna + circuit + clock + compass`, which is a somewhat difficult recipe (`antenna` requires `silver` which requires a `deep mine`; a `clock` requires `quartz` + a bunch of `iron gears`, etc.). One might wonder whether we should make the recipe easier since finding out where you are seems like a kind of fundamental operation. However, consider that in order to even be able to make use of the result of `whereami` you need at least (1) an `ADT calculator` to deal with the pair (which transitively requires `typewriter` -> `circuit` -> `silicon` -> `quartz`) (2) probably things like `comparator` and `calculator` to do anything useful with the coordinates. By the time you have those things you can definitely already build `circuit` + `clock` + `compass`, and you're probably not that far away from getting some `silver` for an `antenna`. Also, in practice it's an interesting/fun constraint to build up machinery that has to work entirely based on *relative* position without being able to find out your absolute coordinates. - For some reason this is causing `Testing/508-capability-subset` to fail. I think perhaps it is due to #397 ? I will investigate. *EDIT*: unfortunately, that wasn't it!
Describe the bug
In certain situations with devices that don't exist, an error is generated saying that some other device is missing (even though it is not).
To Reproduce
--cheat
create "branch predictor"
build {move; if (1 > 2) {} {}}
compare
capability.build {move; turn left; if (1 > 2) {} {}}
turn left
; we would expect to get the same error. Instead we get an error likeYou do not have the devices required for: 'move; turn left; if (1 > 2) {noop} {noop}' please obtain: - branch predictor
Additional context
First noticed this in #373 (comment) . Note that once #395 is merged then we will have a
comparator
device so the above example won't work any more.The text was updated successfully, but these errors were encountered: