xls icon indicating copy to clipboard operation
xls copied to clipboard

DSLX: RET_CHECK on unparseable input

Open RobSpringer opened this issue 2 years ago • 0 comments

In the unit test gf_128_mul_test (maybe not committed yet), I triggered an error when the test accidentally ended with:

    let z = gf128_mul(b, a);
    assert_eq(z, expected)
    ()

Note that line N-1 isn't a let. A) the parser should catch this as an error and B) we shouldn't splat a RET_CHECK at the user. The exact error text:

0x5640eba50162: std::__u::__function::__policy_func<>::operator()()
0x5640eba4ffb2: std::__u::function<>::operator()()
0x5640eba13e9c: xls::dslx::(anonymous namespace)::DeduceInstantiation()
0x5640eba12783: xls::dslx::(anonymous namespace)::DeduceInvocation()
0x5640eb9f818b: xls::dslx::(anonymous namespace)::DeduceVisitor::HandleInvocation()
0x5640ebd15ca2: xls::dslx::Invocation::Accept()
0x5640eb9f5d0e: xls::dslx::(anonymous namespace)::DeduceInternal()
0x5640eb9f5839: xls::dslx::Deduce()
0x5640eb9f3dd6: std::__u::__invoke<>()
0x5640eb9f3d8d: std::__u::__invoke_void_return_wrapper<>::__call<>()
0x5640eb9f3d00: std::__u::__function::__default_alloc_func<>::operator()()
0x5640eb9f3c2e: std::__u::__function::__policy_invoker<>::__call_impl<>()
0x5640eb9e1a72: std::__u::__function::__policy_func<>::operator()()
0x5640eb9e18c2: std::__u::function<>::operator()()
0x5640eb9d4c7a: xls::dslx::DeduceCtx::Deduce()
0x5640eba16757: xls::dslx::(anonymous namespace)::DeduceLet()
0x5640eb9f834b: xls::dslx::(anonymous namespace)::DeduceVisitor::HandleLet()
0x5640ebd182f2: xls::dslx::Let::Accept()
0x5640eb9f5d0e: xls::dslx::(anonymous namespace)::DeduceInternal()
0x5640eb9f5839: xls::dslx::Deduce()
0x5640eb9f3dd6: std::__u::__invoke<>()
0x5640eb9f3d8d: std::__u::__invoke_void_return_wrapper<>::__call<>()
0x5640eb9f3d00: std::__u::__function::__default_alloc_func<>::operator()()
0x5640eb9f3c2e: std::__u::__function::__policy_invoker<>::__call_impl<>()
0x5640eb9e1a72: std::__u::__function::__policy_func<>::operator()()
0x5640eb9e18c2: std::__u::function<>::operator()()
0x5640eb9d4c7a: xls::dslx::DeduceCtx::Deduce()
0x5640eba16757: xls::dslx::(anonymous namespace)::DeduceLet()
0x5640eb9f834b: xls::dslx::(anonymous namespace)::DeduceVisitor::HandleLet()
0x5640ebd182f2: xls::dslx::Let::Accept()
0x5640eb9f5d0e: xls::dslx::(anonymous namespace)::DeduceInternal()
0x5640eb9f5839: xls::dslx::Deduce()
0x5640eb9f3dd6: std::__u::__invoke<>()
0x5640eb9f3d8d: std::__u::__invoke_void_return_wrapper<>::__call<>()
0x5640eb9f3d00: std::__u::__function::__default_alloc_func<>::operator()()
0x5640eb9f3c2e: std::__u::__function::__policy_invoker<>::__call_impl<>()
0x5640eb9e1a72: std::__u::__function::__policy_func<>::operator()()
0x5640eb9e18c2: std::__u::function<>::operator()()
0x5640eb9d4c7a: xls::dslx::DeduceCtx::Deduce()
0x5640eba16757: xls::dslx::(anonymous namespace)::DeduceLet()
0x5640eb9f834b: xls::dslx::(anonymous namespace)::DeduceVisitor::HandleLet()

E0822 10:45:23.847794  840437 command_line_utils.cc:35] Could not extract a textual position from error message: INTERNAL: XLS_RET_CHECK failure (xls/dslx/deduce.cc:2566) name_ref != nullptr
=== Source Location Trace: ===
xls/common/status/status_builder.cc:160
: INVALID_ARGUMENT: Provided status is not in recognized error form: INTERNAL: XLS_RET_CHECK failure (xls/dslx/deduce.cc:2566) name_ref != nullptr
=== Source Location Trace: ===
xls/dslx/bindings.cc:28

F0822 10:45:23.873953  840437 interpreter_main.cc:152] Check failed: ::absl::OkStatus() == (status) (OK vs. INTERNAL: XLS_RET_CHECK failure (xls/dslx/deduce.cc:2566) name_ref != nullptr
=== Source Location Trace: ===
xls/common/status/status_builder.cc:160
)

RobSpringer avatar Aug 22 '22 17:08 RobSpringer