type inferencer crash on artiq_sinara_tester #432
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Depends on
Reference: M-Labs/nac3#432
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ARTIQ 567cd45eee11df62a3ce29453c00935b445a1492
Crash:
No hardware necessary for repro.
(All code references are referencing to
567cd45eee
)Following the logs, the offending line is in
artiq/frontend/artiq_sinara_tester.py:879
.In particular, it is
dcbias[ch]
that is causing a panic innac3core
'stypecheck/type_inferencer/mod.rs
'sinfer_subscript()
withinimpl Inferencer
.The reason is that
dcbias
is declared to be of type objectclass ShuttlerDCBias
in the function parameters, and it is simply illegal to index into a value that is typed as an object (NOTE: except forndarray
s, and disregarding__getitem__
and its friends,nac3core
does not have that currently if I am correct). More formally,nac3core
only supports indexing into aTuple
, aList
, or anndarray
if the value being index-ed is an object.The parameters of
SinaraTester.setup_shutter_set_output
(and alsoSinaraTester.setup_shutter_init
) are mistyped and should have been:I believe so is because of how
SinaraTester.setup_shutter_set_output
is being used. Here is what I found inartiq/frontend/artiq_sinara_tester.py
by tracing through the source code:SinaraTester.setup_shuttler_set_output
is used bySinaraTester.setup_shuttler_init
(which I believe is also mistyped for the parametersdcbias
anddds
) like so:SinaraTester.setup_shuttler_init
is used bySinaraTester.test_shuttler
like so:card_dev["dcbias"]
inSinaraTester.setup_shuttler_init
could be inferred from howSinaraTester.build()
constructsself.shuttler
:Therefore
self.shuttler[<a shutter_name>]["dcbias"]
is alist[coredevice.shuttler.DCBias]
, the same goes forself.shuttler[<a shutter_name>]["dds"]
.Other things to consider:
nac3core
should change the panic caused by this issue to a proper error report.SinaraTester.setup_shutter_set_output
andSinaraTester.setup_shutter_init
, and it did fix the panic. But in fact there are more compiling issues withartiq/frontend/artiq_sinara_tester.py
. Here are some of them (there are more):I fixed sinara_tester, but the original NAC3 error message needs to be fixed.
I will work on improving the error after completing #427.