Stream: git-wasmtime

Topic: wasmtime / issue #3539 ISLE: extern extractors required t...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 16 2021 at 22:40):

alexcrichton opened issue #3539:

Given this input:

(type u64 (primitive u64))

(decl imm (u64) u64)
(rule (imm (classify_imm n)) n)

(decl classify_imm (u64) u64)
(extern extractor classify_imm classify_imm)

I get (running islec):

$ cargo run -p islec -- input.isle
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `/home/acrichto/code/wasmtime/target/debug/islec input.isle`
Error:
  × type error: Cannot use term 'classify_imm' that does not have a defined extractor in a left-hand side pattern
   ╭─[input.isle:3:1]
 3  (decl imm (u64) u64)
 4  (rule (imm (classify_imm n)) n)
   ·            
   ·            ╰── Cannot use term 'classify_imm' that does not have a defined extractor in a left-hand side pattern
 5 
   ╰────

If, however, I change the input:

(type u64 (primitive u64))

(decl classify_imm (u64) u64)
(extern extractor classify_imm classify_imm)

(decl imm (u64) u64)
(rule (imm (classify_imm n)) n)

the compile succeeds

view this post on Zulip Wasmtime GitHub notifications bot (Nov 16 2021 at 22:40):

alexcrichton labeled issue #3539:

Given this input:

(type u64 (primitive u64))

(decl imm (u64) u64)
(rule (imm (classify_imm n)) n)

(decl classify_imm (u64) u64)
(extern extractor classify_imm classify_imm)

I get (running islec):

$ cargo run -p islec -- input.isle
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `/home/acrichto/code/wasmtime/target/debug/islec input.isle`
Error:
  × type error: Cannot use term 'classify_imm' that does not have a defined extractor in a left-hand side pattern
   ╭─[input.isle:3:1]
 3  (decl imm (u64) u64)
 4  (rule (imm (classify_imm n)) n)
   ·            
   ·            ╰── Cannot use term 'classify_imm' that does not have a defined extractor in a left-hand side pattern
 5 
   ╰────

If, however, I change the input:

(type u64 (primitive u64))

(decl classify_imm (u64) u64)
(extern extractor classify_imm classify_imm)

(decl imm (u64) u64)
(rule (imm (classify_imm n)) n)

the compile succeeds

view this post on Zulip Wasmtime GitHub notifications bot (Nov 16 2021 at 22:40):

github-actions[bot] commented on issue #3539:

Subscribe to Label Action

cc @cfallin, @fitzgen

<details>
This issue or pull request has been labeled: "isle"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Nov 16 2021 at 22:42):

fitzgen commented on issue #3539:

I suspect what is happening is that we are collecting extern extractor information and checking rule patterns in the same pass over the IR, when we need to collect all extern extractor info in one pass, and then do a second pass where we check rule patterns.

view this post on Zulip Wasmtime GitHub notifications bot (May 10 2022 at 22:15):

cfallin commented on issue #3539:

I think this was fixed recently by #4079; closing.

view this post on Zulip Wasmtime GitHub notifications bot (May 10 2022 at 22:15):

cfallin closed issue #3539:

Given this input:

(type u64 (primitive u64))

(decl imm (u64) u64)
(rule (imm (classify_imm n)) n)

(decl classify_imm (u64) u64)
(extern extractor classify_imm classify_imm)

I get (running islec):

$ cargo run -p islec -- input.isle
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `/home/acrichto/code/wasmtime/target/debug/islec input.isle`
Error:
  × type error: Cannot use term 'classify_imm' that does not have a defined extractor in a left-hand side pattern
   ╭─[input.isle:3:1]
 3  (decl imm (u64) u64)
 4  (rule (imm (classify_imm n)) n)
   ·            
   ·            ╰── Cannot use term 'classify_imm' that does not have a defined extractor in a left-hand side pattern
 5 
   ╰────

If, however, I change the input:

(type u64 (primitive u64))

(decl classify_imm (u64) u64)
(extern extractor classify_imm classify_imm)

(decl imm (u64) u64)
(rule (imm (classify_imm n)) n)

the compile succeeds


Last updated: Dec 23 2024 at 12:05 UTC