deterministic error message #190

Closed
opened 2022-02-13 12:00:54 +08:00 by sb10q · 6 comments

When there are several errors in the user code, it should be deterministic which one is printed.
Currently you can get a different one by just re-running the compiler, which makes debugging very tedious.

When there are several errors in the user code, it should be deterministic which one is printed. Currently you can get a different one by just re-running the compiler, which makes debugging very tedious.
sb10q added the
high-priority
label 2022-02-13 12:00:54 +08:00
Poster
Owner

For example those are consecutive runs without touching anything:

> artiq_compile nac3devices.py
Traceback (most recent call last):
  File "/nix/store/zjn3gl4h47vg2kcimk88xbahs9ab6215-python3.9-artiq-8.0-unknown-beta/bin/.artiq_compile-wrapped", line 9, in <module>
    sys.exit(main())
  File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main
    exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile
    self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map)
RuntimeError: nac3 compilation failure: type error at identifier `ValueError` (cannot find symbol `ValueError`) at /home/sb/artiq/artiq/coredevice/mirny.py: line 129 column 23
> artiq_compile nac3devices.py
Traceback (most recent call last):
  File "/nix/store/zjn3gl4h47vg2kcimk88xbahs9ab6215-python3.9-artiq-8.0-unknown-beta/bin/.artiq_compile-wrapped", line 9, in <module>
    sys.exit(main())
  File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main
    exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile
    self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map)
RuntimeError: nac3 compilation failure: type error at identifier `ValueError` (cannot find symbol `ValueError`) at /home/sb/artiq/artiq/coredevice/urukul.py: line 256 column 23
> artiq_compile nac3devices.py
Traceback (most recent call last):
  File "/nix/store/zjn3gl4h47vg2kcimk88xbahs9ab6215-python3.9-artiq-8.0-unknown-beta/bin/.artiq_compile-wrapped", line 9, in <module>
    sys.exit(main())
  File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main
    exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile
    self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map)
RuntimeError: nac3 compilation failure: type error at identifier `ValueError` (cannot find symbol `ValueError`) at /home/sb/artiq/artiq/coredevice/mirny.py: line 129 column 23
> artiq_compile nac3devices.py
Traceback (most recent call last):
  File "/nix/store/zjn3gl4h47vg2kcimk88xbahs9ab6215-python3.9-artiq-8.0-unknown-beta/bin/.artiq_compile-wrapped", line 9, in <module>
    sys.exit(main())
  File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main
    exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile
    self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map)
RuntimeError: nac3 compilation failure: unknown type

The last error message is also particularly bad without any kind of provenance information.

For example those are consecutive runs without touching anything: ``` > artiq_compile nac3devices.py Traceback (most recent call last): File "/nix/store/zjn3gl4h47vg2kcimk88xbahs9ab6215-python3.9-artiq-8.0-unknown-beta/bin/.artiq_compile-wrapped", line 9, in <module> sys.exit(main()) File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output) File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map) RuntimeError: nac3 compilation failure: type error at identifier `ValueError` (cannot find symbol `ValueError`) at /home/sb/artiq/artiq/coredevice/mirny.py: line 129 column 23 > artiq_compile nac3devices.py Traceback (most recent call last): File "/nix/store/zjn3gl4h47vg2kcimk88xbahs9ab6215-python3.9-artiq-8.0-unknown-beta/bin/.artiq_compile-wrapped", line 9, in <module> sys.exit(main()) File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output) File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map) RuntimeError: nac3 compilation failure: type error at identifier `ValueError` (cannot find symbol `ValueError`) at /home/sb/artiq/artiq/coredevice/urukul.py: line 256 column 23 > artiq_compile nac3devices.py Traceback (most recent call last): File "/nix/store/zjn3gl4h47vg2kcimk88xbahs9ab6215-python3.9-artiq-8.0-unknown-beta/bin/.artiq_compile-wrapped", line 9, in <module> sys.exit(main()) File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output) File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map) RuntimeError: nac3 compilation failure: type error at identifier `ValueError` (cannot find symbol `ValueError`) at /home/sb/artiq/artiq/coredevice/mirny.py: line 129 column 23 > artiq_compile nac3devices.py Traceback (most recent call last): File "/nix/store/zjn3gl4h47vg2kcimk88xbahs9ab6215-python3.9-artiq-8.0-unknown-beta/bin/.artiq_compile-wrapped", line 9, in <module> sys.exit(main()) File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output) File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map) RuntimeError: nac3 compilation failure: unknown type ``` The last error message is also particularly bad without any kind of provenance information.
Poster
Owner

The last error message is also particularly bad without any kind of provenance information.

#193

> The last error message is also particularly bad without any kind of provenance information. https://git.m-labs.hk/M-Labs/nac3/issues/193

Well this is actually not that hard, we could just combine the error messages from all threads together. This undeterministic error message is due to having several errors in different threads, and we currently only report the first one.

Apart from this, I guess we should also need a diagnostic struct to store both errors and warnings, so we could solve #118.

For error messages regarding tuples, unknown exceptions etc., we will need to change the return type of a lot of functions to result. Will fix this later.

Well this is actually not that hard, we could just combine the error messages from all threads together. This undeterministic error message is due to having several errors in different threads, and we currently only report the first one. Apart from this, I guess we should also need a diagnostic struct to store both errors and warnings, so we could solve #118. For error messages regarding tuples, unknown exceptions etc., we will need to change the return type of a lot of functions to result. Will fix this later.
sb10q closed this issue 2022-02-22 16:08:16 +08:00
Poster
Owner

There's still plenty of non-determinism. Without changing anything:

> artiq_compile nac3devices.py
Traceback (most recent call last):
  File "/nix/store/i7dvbxk7mzc9vr8ay2nqqayykskr0m4r-python3.9-artiq-8.0.unknown.beta/bin/.artiq_compile-wrapped", line 9, in <module>
    sys.exit(main())
  File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main
    exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile
    self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map)
RuntimeError: nac3 compilation failure: 
----------
Incorrect argument type for other. Expected int32, but got float at /home/sb/artiq/artiq/coredevice/sampler.py: line 138 column 26
----------
`artiq.coredevice.sampler.Sampler::gains` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 103 column 17
----------
`list[int32]::__mul__` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 158 column 23
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 111 column 23 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 343 column 29 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 187 column 45 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 207 column 37 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 224 column 21 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 231 column 21 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 220 column 19 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 332 column 18 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 417 column 22 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 549 column 44 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 559 column 54 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 592 column 12 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/spi2.py: line 210 column 38 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 359 column 57 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 382 column 58 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 450 column 51 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 485 column 31 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 492 column 26 but got TVar
----------
expected concrete type at nac3devices.py: line 49 column 41 but got TCall
----------
type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 115 column 50
----------
type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 88 column 49
----------
type error at identifier `volt_per_lsb` (cannot find symbol `volt_per_lsb`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 46 column 24



> artiq_compile nac3devices.py
Traceback (most recent call last):
  File "/nix/store/i7dvbxk7mzc9vr8ay2nqqayykskr0m4r-python3.9-artiq-8.0.unknown.beta/bin/.artiq_compile-wrapped", line 9, in <module>
    sys.exit(main())
  File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main
    exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile
    self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map)
RuntimeError: nac3 compilation failure: 
----------
Incorrect argument type for other. Expected int32, but got float at /home/sb/artiq/artiq/coredevice/sampler.py: line 138 column 26
----------
`artiq.coredevice.sampler.Sampler::gains` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 103 column 17
----------
`list[int32]::__mul__` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 158 column 23
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 111 column 23 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 343 column 29 but got TVar
----------
type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 115 column 50
----------
type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 88 column 49
----------
type error at identifier `volt_per_lsb` (cannot find symbol `volt_per_lsb`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 46 column 24



> artiq_compile nac3devices.py

Traceback (most recent call last):
  File "/nix/store/i7dvbxk7mzc9vr8ay2nqqayykskr0m4r-python3.9-artiq-8.0.unknown.beta/bin/.artiq_compile-wrapped", line 9, in <module>
    sys.exit(main())
  File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main
    exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile
    self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map)
RuntimeError: nac3 compilation failure: 
----------
Incorrect argument type for other. Expected int32, but got float at /home/sb/artiq/artiq/coredevice/sampler.py: line 138 column 26
----------
`artiq.coredevice.sampler.Sampler::gains` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 103 column 17
----------
`list[int32]::__mul__` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 158 column 23
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 111 column 23 but got TVar
----------
type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 115 column 50
----------
type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 88 column 49
----------
type error at identifier `volt_per_lsb` (cannot find symbol `volt_per_lsb`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 46 column 24


> artiq_compile nac3devices.py
Traceback (most recent call last):
  File "/nix/store/i7dvbxk7mzc9vr8ay2nqqayykskr0m4r-python3.9-artiq-8.0.unknown.beta/bin/.artiq_compile-wrapped", line 9, in <module>
    sys.exit(main())
  File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main
    exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile
    self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map)
RuntimeError: nac3 compilation failure: 
----------
Incorrect argument type for other. Expected int32, but got float at /home/sb/artiq/artiq/coredevice/sampler.py: line 138 column 26
----------
`artiq.coredevice.sampler.Sampler::gains` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 103 column 17
----------
`list[int32]::__mul__` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 158 column 23
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 111 column 23 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 343 column 29 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 187 column 45 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 207 column 37 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 224 column 21 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 231 column 21 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 220 column 19 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 332 column 18 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 417 column 22 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 549 column 44 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 559 column 54 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 592 column 12 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/core.py: line 100 column 16 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/core.py: line 108 column 21 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 359 column 57 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 382 column 58 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 450 column 51 but got TCall
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 485 column 31 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 492 column 26 but got TVar
----------
expected concrete type at /home/sb/artiq/artiq/coredevice/urukul.py: line 400 column 16 but got TCall
----------
expected concrete type at nac3devices.py: line 49 column 41 but got TCall
----------
type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 115 column 50
----------
type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 88 column 49
----------
type error at identifier `volt_per_lsb` (cannot find symbol `volt_per_lsb`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 46 column 24

There's still plenty of non-determinism. Without changing anything: ``` > artiq_compile nac3devices.py Traceback (most recent call last): File "/nix/store/i7dvbxk7mzc9vr8ay2nqqayykskr0m4r-python3.9-artiq-8.0.unknown.beta/bin/.artiq_compile-wrapped", line 9, in <module> sys.exit(main()) File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output) File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map) RuntimeError: nac3 compilation failure: ---------- Incorrect argument type for other. Expected int32, but got float at /home/sb/artiq/artiq/coredevice/sampler.py: line 138 column 26 ---------- `artiq.coredevice.sampler.Sampler::gains` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 103 column 17 ---------- `list[int32]::__mul__` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 158 column 23 ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 111 column 23 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 343 column 29 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 187 column 45 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 207 column 37 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 224 column 21 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 231 column 21 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 220 column 19 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 332 column 18 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 417 column 22 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 549 column 44 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 559 column 54 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 592 column 12 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/spi2.py: line 210 column 38 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 359 column 57 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 382 column 58 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 450 column 51 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 485 column 31 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 492 column 26 but got TVar ---------- expected concrete type at nac3devices.py: line 49 column 41 but got TCall ---------- type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 115 column 50 ---------- type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 88 column 49 ---------- type error at identifier `volt_per_lsb` (cannot find symbol `volt_per_lsb`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 46 column 24 > artiq_compile nac3devices.py Traceback (most recent call last): File "/nix/store/i7dvbxk7mzc9vr8ay2nqqayykskr0m4r-python3.9-artiq-8.0.unknown.beta/bin/.artiq_compile-wrapped", line 9, in <module> sys.exit(main()) File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output) File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map) RuntimeError: nac3 compilation failure: ---------- Incorrect argument type for other. Expected int32, but got float at /home/sb/artiq/artiq/coredevice/sampler.py: line 138 column 26 ---------- `artiq.coredevice.sampler.Sampler::gains` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 103 column 17 ---------- `list[int32]::__mul__` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 158 column 23 ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 111 column 23 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 343 column 29 but got TVar ---------- type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 115 column 50 ---------- type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 88 column 49 ---------- type error at identifier `volt_per_lsb` (cannot find symbol `volt_per_lsb`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 46 column 24 > artiq_compile nac3devices.py Traceback (most recent call last): File "/nix/store/i7dvbxk7mzc9vr8ay2nqqayykskr0m4r-python3.9-artiq-8.0.unknown.beta/bin/.artiq_compile-wrapped", line 9, in <module> sys.exit(main()) File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output) File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map) RuntimeError: nac3 compilation failure: ---------- Incorrect argument type for other. Expected int32, but got float at /home/sb/artiq/artiq/coredevice/sampler.py: line 138 column 26 ---------- `artiq.coredevice.sampler.Sampler::gains` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 103 column 17 ---------- `list[int32]::__mul__` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 158 column 23 ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 111 column 23 but got TVar ---------- type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 115 column 50 ---------- type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 88 column 49 ---------- type error at identifier `volt_per_lsb` (cannot find symbol `volt_per_lsb`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 46 column 24 > artiq_compile nac3devices.py Traceback (most recent call last): File "/nix/store/i7dvbxk7mzc9vr8ay2nqqayykskr0m4r-python3.9-artiq-8.0.unknown.beta/bin/.artiq_compile-wrapped", line 9, in <module> sys.exit(main()) File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 66, in main exp_inst.core.compile(exp_inst.run, [], {}, embedding_map, file_output=output) File "/home/sb/artiq/artiq/coredevice/core.py", line 79, in compile self.compiler.compile_method_to_file(obj, name, args, file_output, embedding_map) RuntimeError: nac3 compilation failure: ---------- Incorrect argument type for other. Expected int32, but got float at /home/sb/artiq/artiq/coredevice/sampler.py: line 138 column 26 ---------- `artiq.coredevice.sampler.Sampler::gains` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 103 column 17 ---------- `list[int32]::__mul__` field/method does not exist at /home/sb/artiq/artiq/coredevice/sampler.py: line 158 column 23 ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 111 column 23 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad53xx.py: line 343 column 29 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 187 column 45 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 207 column 37 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 224 column 21 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ad9912.py: line 231 column 21 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 220 column 19 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 332 column 18 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 417 column 22 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 549 column 44 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 559 column 54 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/adf5356.py: line 592 column 12 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/core.py: line 100 column 16 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/core.py: line 108 column 21 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 359 column 57 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 382 column 58 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 450 column 51 but got TCall ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 485 column 31 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/ttl.py: line 492 column 26 but got TVar ---------- expected concrete type at /home/sb/artiq/artiq/coredevice/urukul.py: line 400 column 16 but got TCall ---------- expected concrete type at nac3devices.py: line 49 column 41 but got TCall ---------- type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 115 column 50 ---------- type error at identifier `spi` (cannot find symbol `spi`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 88 column 49 ---------- type error at identifier `volt_per_lsb` (cannot find symbol `volt_per_lsb`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 46 column 24 ```
sb10q reopened this issue 2022-02-25 18:18:16 +08:00
Collaborator

Are there any instructions on how to reproduce this issue with nac3devices.py? I wasn't able to find a device_db.py which enables nac3devices.py to be compiled.

Are there any instructions on how to reproduce this issue with `nac3devices.py`? I wasn't able to find a `device_db.py` which enables `nac3devices.py` to be compiled.
Collaborator

After digging into the codebase, it seems like the non-determinism might be due to the compiler using multiple threads for compilation. Compounded by the fact that 1. use multiple threads may change the compilation order of files, and 2. the compiling thread will stop compilation upon its first error, it seems like the only way to solve this issue is to continue compilation until all jobs have been completed.

Edit: But based on how compilation is performed (i.e. via decorator hooks) I am not sure if there is a way to collect all errors during compilation...

After digging into the codebase, it seems like the non-determinism might be due to the compiler using multiple threads for compilation. Compounded by the fact that 1. use multiple threads may change the compilation order of files, and 2. the compiling thread will stop compilation upon its first error, it seems like the only way to solve this issue is to continue compilation until all jobs have been completed. Edit: But based on how compilation is performed (i.e. via decorator hooks) I am not sure if there is a way to collect all errors during compilation...
sb10q closed this issue 2023-12-12 15:42:10 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#190
There is no content yet.