Consensys / corset

4 stars 10 forks source link

Interleaved columns should have the same `:display :type` as source columns #119

Open letypequividelespoubelles opened 1 month ago

DavePearce commented 1 month ago

A minimal example is:

(defcolumns (A :display :bytes) (B :display :bytes))
(definterleaved C (A B))
;; Simple ordering constraint
(defconstraint order ()
  (if-not-zero C
               (or! (eq! C (next C)) (eq! (+ 1 C) (next C)))))

With the following input trace:

{ "<prelude>": {"A": [0,16384], "B": [0,16385] } }

Then we currently get this view:

    0   1   2     3   4      5
 A  00  00  40 00 .   .      .
 B  00  00  40 01 .   .      .
 C  0x0 0x0 0x0   0x0 0x4000 0x4001

What we can see is that C does not have the :display :bytes modifier that both of its source columns do.

DavePearce commented 1 month ago

This also holds for e.g. :display :dec.

DavePearce commented 1 month ago

@letypequividelespoubelles One option which currently works is to explicitly specify the required :display type. For my example above, this looks like:

(defcolumns (A :display :bytes) (B :display :bytes))
(definterleaved (C :display :bytes) (A B))
...

Is that enough to resolve this?

letypequividelespoubelles commented 1 month ago

Yes, it would be a good feature to have same display type by default, but it's a very low low priority.

Th