det-lab / kaitai_struct_awkward_runtime

Kaitai Struct: runtime for Awkward Arrays
MIT License
2 stars 2 forks source link

Create a simplified scdms.ksy for testing Enums #30

Closed zonca closed 8 months ago

zonca commented 9 months ago

Creating a simplified scdms.ksy format just for testing Enums would allow me to more easily understand the flow in the Scala compiler.

However, currently this simplified file doesn't compile in the current compiler. Need some help understanding if something is wrong in the ksy file or there is a bug in the Awkward-Kaitai compiler itself.

zonca commented 9 months ago

here is the cpp file created: https://gist.github.com/zonca/0cf91c1d729aebeb38b005f608acb51d

@ManasviGoyal the simplified ksy file compiles fine to cpp and to the dynamic library, but fails at runtime with:

E           RuntimeError: Record node1 has field "v_one_trig_metaA__Ztrigger_type" length 0 that differs from the first length 1

do you know what might be wrong?

zonca commented 9 months ago

@ManasviGoyal I added a simple data file created with numpy tofile array method. I tested it on the kaitai ide and seems to me it works fine:

image

zonca commented 8 months ago

@ManasviGoyal I think this could be merged, it just add the simple enum test, which already proved useful by triggering the bugfix in 9489fd5