[Mlir-commits] [mlir] Reland: [mlir][tosa] Improve level check error messages (PR #178248)

Luke Hutton llvmlistbot at llvm.org
Tue Jan 27 08:22:37 PST 2026


https://github.com/lhutton1 created https://github.com/llvm/llvm-project/pull/178248

This commit adds expected and actual values to the level check error messages, making it easier for a user to diagnose issues.

>From 33cd55c4e0fdd19b239795f6e26738d13a40a85d Mon Sep 17 00:00:00 2001
From: Luke Hutton <luke.hutton at arm.com>
Date: Tue, 27 Jan 2026 15:35:40 +0000
Subject: [PATCH 1/2] [mlir][tosa] Improve level check error messages (#174980)

This commit adds expected and actual values to the level check error
messages, making it easier for a user to diagnose issues.
---
 .../Tosa/Transforms/TosaValidation.cpp        |  98 +++++++-------
 mlir/test/Dialect/Tosa/level_check.mlir       | 120 +++++++++---------
 2 files changed, 113 insertions(+), 105 deletions(-)

diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
index d4241d1428956..97572fdd13953 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
@@ -27,6 +27,7 @@
 #include "mlir/Pass/Pass.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/FormatVariadic.h"
 
 namespace mlir {
 namespace tosa {
@@ -189,33 +190,40 @@ struct TosaValidation : public tosa::impl::TosaValidationBase<TosaValidation> {
     constCheckers.emplace_back(checkConstantOperandSilceShape);
   }
 
-  LogicalResult levelCheckKernel(Operation *op, int32_t v,
-                                 const StringRef checkDesc) {
-    if (v > targetEnv.getLevel().MAX_KERNEL)
-      return op->emitOpError() << "failed level check: " << checkDesc;
+  LogicalResult levelCheck(Operation *op, const int32_t calculatedValue,
+                           const int32_t maxLevel, const StringRef inputName,
+                           const StringRef levelName) {
+    if (calculatedValue > maxLevel)
+      return op->emitOpError()
+             << "failed level check: " << inputName << " <= " << levelName
+             << " (" << maxLevel << "), got " << calculatedValue;
     return success();
   }
 
+  LogicalResult levelCheckKernel(Operation *op, int32_t v,
+                                 const StringRef inputName) {
+    return levelCheck(op, v, targetEnv.getLevel().MAX_KERNEL, inputName,
+                      "MAX_KERNEL");
+  }
+
   LogicalResult levelCheckStride(Operation *op, int32_t v,
-                                 const StringRef checkDesc) {
-    if (v > targetEnv.getLevel().MAX_STRIDE)
-      return op->emitOpError() << "failed level check: " << checkDesc;
-    return success();
+                                 const StringRef inputName) {
+    return levelCheck(op, v, targetEnv.getLevel().MAX_STRIDE, inputName,
+                      "MAX_STRIDE");
   }
 
   LogicalResult levelCheckScale(Operation *op, int32_t v,
-                                const StringRef checkDesc) {
-    if (v > targetEnv.getLevel().MAX_SCALE)
-      return op->emitOpError() << "failed level check: " << checkDesc;
-    return success();
+                                const StringRef inputName) {
+    return levelCheck(op, v, targetEnv.getLevel().MAX_SCALE, inputName,
+                      "MAX_SCALE");
   }
 
   LogicalResult levelCheckListSize(Operation *op, int32_t v,
-                                   const StringRef checkDesc) {
-    if (v > targetEnv.getLevel().MAX_TENSOR_LIST_SIZE)
-      return op->emitOpError()
-             << "failed level check for MAX_TENSOR_LIST_SIZE: " << checkDesc;
-    return success();
+                                   const StringRef inputName) {
+    const std::string inputDesc =
+        llvm::formatv("length(tensor_list_shape({0}))", inputName);
+    return levelCheck(op, v, targetEnv.getLevel().MAX_TENSOR_LIST_SIZE,
+                      inputDesc, "MAX_TENSOR_LIST_SIZE");
   }
 
   // Perform the Level Rank check on the tensor type.
@@ -317,17 +325,17 @@ struct TosaValidation : public tosa::impl::TosaValidationBase<TosaValidation> {
   LogicalResult levelCheckPool(Operation *op) {
     if (auto poolOp = dyn_cast<T>(op)) {
       for (auto k : poolOp.getKernel()) {
-        if (failed(levelCheckKernel(op, k, "kernel <= MAX_KERNEL"))) {
+        if (failed(levelCheckKernel(op, k, "kernel"))) {
           return failure();
         }
       }
       for (auto s : poolOp.getStride()) {
-        if (failed(levelCheckStride(op, s, "stride <= MAX_STRIDE"))) {
+        if (failed(levelCheckStride(op, s, "stride"))) {
           return failure();
         }
       }
       for (auto p : poolOp.getPad()) {
-        if (failed(levelCheckKernel(op, p, "pad <= MAX_KERNEL"))) {
+        if (failed(levelCheckKernel(op, p, "pad"))) {
           return failure();
         }
       }
@@ -341,17 +349,17 @@ struct TosaValidation : public tosa::impl::TosaValidationBase<TosaValidation> {
     if (auto convOp = dyn_cast<T>(op)) {
 
       for (auto k : convOp.getDilation()) {
-        if (failed(levelCheckKernel(op, k, "dilation <= MAX_KERNEL"))) {
+        if (failed(levelCheckKernel(op, k, "dilation"))) {
           return failure();
         }
       }
       for (auto p : convOp.getPad()) {
-        if (failed(levelCheckKernel(op, p, "pad <= MAX_KERNEL"))) {
+        if (failed(levelCheckKernel(op, p, "pad"))) {
           return failure();
         }
       }
       for (auto s : convOp.getStride()) {
-        if (failed(levelCheckStride(op, s, "stride <= MAX_STRIDE"))) {
+        if (failed(levelCheckStride(op, s, "stride"))) {
           return failure();
         }
       }
@@ -363,27 +371,27 @@ struct TosaValidation : public tosa::impl::TosaValidationBase<TosaValidation> {
           assert(shape.size() == 4);
           assert(dilation.size() == 2);
           if (failed(levelCheckKernel(op, dilation[0] * shape[1],
-                                      "dilation_y * KH <= MAX_KERNEL)")) ||
+                                      "dilation_y * KH")) ||
               failed(levelCheckKernel(op, dilation[1] * shape[2],
-                                      "dilation_x * KW <= MAX_KERNEL)")))
+                                      "dilation_x * KW")))
             return failure();
         } else if (isa<tosa::Conv3DOp>(op)) {
           assert(shape.size() == 5);
           assert(dilation.size() == 3);
           if (failed(levelCheckKernel(op, dilation[0] * shape[1],
-                                      "dilation_d * KD <= MAX_KERNEL)")) ||
+                                      "dilation_d * KD")) ||
               failed(levelCheckKernel(op, dilation[1] * shape[2],
-                                      "dilation_y * KH <= MAX_KERNEL)")) ||
+                                      "dilation_y * KH")) ||
               failed(levelCheckKernel(op, dilation[2] * shape[3],
-                                      "dilation_x * KW <= MAX_KERNEL)")))
+                                      "dilation_x * KW")))
             return failure();
         } else if (isa<tosa::DepthwiseConv2DOp>(op)) {
           assert(shape.size() == 4);
           assert(dilation.size() == 2);
           if (failed(levelCheckKernel(op, dilation[0] * shape[0],
-                                      "dilation_y * KH <= MAX_KERNEL)")) ||
+                                      "dilation_y * KH")) ||
               failed(levelCheckKernel(op, dilation[1] * shape[1],
-                                      "dilation_x * KW <= MAX_KERNEL)")))
+                                      "dilation_x * KW")))
             return failure();
         }
       }
@@ -445,8 +453,8 @@ struct TosaValidation : public tosa::impl::TosaValidationBase<TosaValidation> {
         if (ShapedType type = dyn_cast<ShapedType>(v.getType())) {
           auto shape = type.getShape();
           assert(shape.size() == 3);
-          if (failed(levelCheckKernel(op, shape[1], "H <= MAX_KERNEL")) ||
-              failed(levelCheckKernel(op, shape[2], "W <= MAX_KERNEL"))) {
+          if (failed(levelCheckKernel(op, shape[1], "H")) ||
+              failed(levelCheckKernel(op, shape[2], "W"))) {
             return failure();
           }
         }
@@ -463,18 +471,18 @@ struct TosaValidation : public tosa::impl::TosaValidationBase<TosaValidation> {
         auto shape = filterType.getShape();
         assert(shape.size() == 4);
         // level check kernel sizes for kH and KW
-        if (failed(levelCheckKernel(op, shape[1], "KH <= MAX_KERNEL")) ||
-            failed(levelCheckKernel(op, shape[2], "KW <= MAX_KERNEL"))) {
+        if (failed(levelCheckKernel(op, shape[1], "KH")) ||
+            failed(levelCheckKernel(op, shape[2], "KW"))) {
           return failure();
         }
       }
       for (auto p : transpose.getOutPad()) {
-        if (failed(levelCheckKernel(op, p, "pad <= MAX_KERNEL"))) {
+        if (failed(levelCheckKernel(op, p, "pad"))) {
           return failure();
         }
       }
       for (auto s : transpose.getStride()) {
-        if (failed(levelCheckStride(op, s, "stride <= MAX_STRIDE"))) {
+        if (failed(levelCheckStride(op, s, "stride"))) {
           return failure();
         }
       }
@@ -494,10 +502,10 @@ struct TosaValidation : public tosa::impl::TosaValidationBase<TosaValidation> {
       const int64_t scaleYD = scale[1];
       const int64_t scaleXN = scale[2];
       const int64_t scaleXD = scale[3];
-      if (failed(levelCheckScale(op, scaleYN / scaleYD,
-                                 "scale_y_n/scale_y_d <= MAX_SCALE")) ||
-          failed(levelCheckScale(op, scaleXN / scaleXD,
-                                 "scale_x_n/scale_x_d <= MAX_SCALE"))) {
+      if (failed(
+              levelCheckScale(op, scaleYN / scaleYD, "scale_y_n/scale_y_d")) ||
+          failed(
+              levelCheckScale(op, scaleXN / scaleXD, "scale_x_n/scale_x_d"))) {
         return failure();
       }
     }
@@ -524,11 +532,11 @@ struct TosaValidation : public tosa::impl::TosaValidationBase<TosaValidation> {
     int32_t maxNestedDepth = 0;
     getMaxNestedDepth(op, maxNestedDepth);
 
-    if (maxNestedDepth >= targetEnv.getLevel().MAX_NESTING) {
-      op->emitOpError() << "failed level check: " << maxNestedDepth
-                        << " >= MAX_NESTING";
-      return failure();
-    }
+    const int32_t maxNestingLevel = targetEnv.getLevel().MAX_NESTING;
+    if (maxNestedDepth >= maxNestingLevel)
+      return op->emitOpError()
+             << "failed level check: tosa_nesting_depth < MAX_NESTING" << " ("
+             << maxNestingLevel << "), got " << maxNestedDepth;
     return success();
   }
 
diff --git a/mlir/test/Dialect/Tosa/level_check.mlir b/mlir/test/Dialect/Tosa/level_check.mlir
index fe02864c8b28f..5375cbb5cbc0d 100644
--- a/mlir/test/Dialect/Tosa/level_check.mlir
+++ b/mlir/test/Dialect/Tosa/level_check.mlir
@@ -521,7 +521,7 @@ func.func @test_identity_rank_valid(%arg0: tensor<i32>) -> tensor<i32> {
 // -----
 
 func.func @test_avgpool2d_kernel_y(%arg0: tensor<1x8194x32x8xf32>, %arg1: tensor<1xf32>, %arg2: tensor<1xf32>) -> tensor<1x2x32x8xf32> {
-  // expected-error at +1 {{'tosa.avg_pool2d' op failed level check: kernel <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.avg_pool2d' op failed level check: kernel <= MAX_KERNEL (8192), got 8193}}
   %0 = "tosa.avg_pool2d"(%arg0, %arg1, %arg2) {kernel = array<i64: 8193, 1>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>, acc_type = f32} :
          (tensor<1x8194x32x8xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x2x32x8xf32>
   return %0 : tensor<1x2x32x8xf32>
@@ -530,7 +530,7 @@ func.func @test_avgpool2d_kernel_y(%arg0: tensor<1x8194x32x8xf32>, %arg1: tensor
 // -----
 
 func.func @test_avgpool2d_kernel_x(%arg0: tensor<1x32x8194x8xf32>, %arg1: tensor<1xf32>, %arg2: tensor<1xf32>) -> tensor<1x32x2x8xf32> {
-  // expected-error at +1 {{'tosa.avg_pool2d' op failed level check: kernel <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.avg_pool2d' op failed level check: kernel <= MAX_KERNEL (8192), got 8193}}
   %0 = "tosa.avg_pool2d"(%arg0, %arg1, %arg2) {kernel = array<i64: 1, 8193>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>, acc_type = f32} :
          (tensor<1x32x8194x8xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x2x8xf32>
   return %0 : tensor<1x32x2x8xf32>
@@ -539,7 +539,7 @@ func.func @test_avgpool2d_kernel_x(%arg0: tensor<1x32x8194x8xf32>, %arg1: tensor
 // -----
 
 func.func @test_avgpool2d_stride_y(%arg0: tensor<1x8194x32x8xf32>, %arg1: tensor<1xf32>, %arg2: tensor<1xf32>) -> tensor<1x2x32x8xf32> {
-  // expected-error at +1 {{'tosa.avg_pool2d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.avg_pool2d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = "tosa.avg_pool2d"(%arg0, %arg1, %arg2) {kernel = array<i64: 1, 1>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 8193, 1>, acc_type = f32} :
          (tensor<1x8194x32x8xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x2x32x8xf32>
   return %0 : tensor<1x2x32x8xf32>
@@ -548,7 +548,7 @@ func.func @test_avgpool2d_stride_y(%arg0: tensor<1x8194x32x8xf32>, %arg1: tensor
 // -----
 
 func.func @test_avgpool2d_stride_x(%arg0: tensor<1x32x8194x8xf32>, %arg1: tensor<1xf32>, %arg2: tensor<1xf32>) -> tensor<1x32x2x8xf32> {
-  // expected-error at +1 {{'tosa.avg_pool2d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.avg_pool2d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = "tosa.avg_pool2d"(%arg0, %arg1, %arg2) {kernel = array<i64: 1, 1>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 8193>, acc_type = f32} :
          (tensor<1x32x8194x8xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x2x8xf32>
   return %0 : tensor<1x32x2x8xf32>
@@ -557,7 +557,7 @@ func.func @test_avgpool2d_stride_x(%arg0: tensor<1x32x8194x8xf32>, %arg1: tensor
 // -----
 
 func.func @test_conv2d_dilation_y(%arg0: tensor<1x8192x8192x1xf32>, %arg1: tensor<16x1025x1024x1xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>) -> tensor<1x1x7170x16xf32> {
-  // expected-error at +1 {{'tosa.conv2d' op failed level check: dilation_y * KH <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv2d' op failed level check: dilation_y * KH <= MAX_KERNEL (8192), got 8200}}
   %0 = tosa.conv2d %arg0, %arg1, %arg2, %arg3, %arg3 {acc_type = f32, dilation = array<i64: 8, 1>, pad = array<i64: 0, 1, 0, 1>, stride = array<i64: 1, 1>} :
             (tensor<1x8192x8192x1xf32>, tensor<16x1025x1024x1xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x1x7170x16xf32>
   return %0 : tensor<1x1x7170x16xf32>
@@ -566,7 +566,7 @@ func.func @test_conv2d_dilation_y(%arg0: tensor<1x8192x8192x1xf32>, %arg1: tenso
 // -----
 
 func.func @test_conv2d_dilation_x(%arg0: tensor<1x8192x8192x1xf32>, %arg1: tensor<16x1024x1025x1xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>) -> tensor<1x7170x1x16xf32> {
-  // expected-error at +1 {{'tosa.conv2d' op failed level check: dilation_x * KW <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv2d' op failed level check: dilation_x * KW <= MAX_KERNEL (8192), got 8200}}
   %0 = tosa.conv2d %arg0, %arg1, %arg2, %arg3, %arg3 {acc_type = f32, dilation = array<i64: 1, 8>, pad = array<i64: 0, 1, 0, 1>, stride = array<i64: 1, 1>} :
             (tensor<1x8192x8192x1xf32>, tensor<16x1024x1025x1xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x7170x1x16xf32>
   return %0 : tensor<1x7170x1x16xf32>
@@ -575,7 +575,7 @@ func.func @test_conv2d_dilation_x(%arg0: tensor<1x8192x8192x1xf32>, %arg1: tenso
 // -----
 
 func.func @test_conv2d_pad_top(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>) -> tensor<1x8225x32x16xf32> {
-  // expected-error at +1 {{'tosa.conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.conv2d %arg0, %arg1, %arg2, %arg3, %arg3 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 8193, 1, 0, 1>, stride = array<i64: 1, 1>} :
             (tensor<1x32x32x8xf32>, tensor<16x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x8225x32x16xf32>
   return %0 : tensor<1x8225x32x16xf32>
@@ -584,7 +584,7 @@ func.func @test_conv2d_pad_top(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x2x
 // -----
 
 func.func @test_conv2d_pad_bottom(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>) -> tensor<1x8224x32x16xf32> {
-  // expected-error at +1 {{'tosa.conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.conv2d %arg0, %arg1, %arg2, %arg3, %arg3 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 8193, 0, 1>, stride = array<i64: 1, 1>} :
             (tensor<1x32x32x8xf32>, tensor<16x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x8224x32x16xf32>
   return %0 : tensor<1x8224x32x16xf32>
@@ -593,7 +593,7 @@ func.func @test_conv2d_pad_bottom(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16
 // -----
 
 func.func @test_conv2d_pad_left(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>) -> tensor<1x32x8225x16xf32> {
-  // expected-error at +1 {{'tosa.conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.conv2d %arg0, %arg1, %arg2, %arg3, %arg3 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 1, 8193, 1>, stride = array<i64: 1, 1>} :
             (tensor<1x32x32x8xf32>, tensor<16x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x8225x16xf32>
   return %0 : tensor<1x32x8225x16xf32>
@@ -602,7 +602,7 @@ func.func @test_conv2d_pad_left(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x2
 // -----
 
 func.func @test_conv2d_pad_right(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>) -> tensor<1x32x8224x16xf32> {
-  // expected-error at +1 {{'tosa.conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.conv2d %arg0, %arg1, %arg2, %arg3, %arg3 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 1, 0, 8193>, stride = array<i64: 1, 1>} :
             (tensor<1x32x32x8xf32>, tensor<16x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x8224x16xf32>
   return %0 : tensor<1x32x8224x16xf32>
@@ -611,7 +611,7 @@ func.func @test_conv2d_pad_right(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x
 // -----
 
 func.func @test_conv2d_stride_y(%arg0: tensor<1x8194x33x8xf32>, %arg1: tensor<16x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>) -> tensor<1x2x33x16xf32> {
-  // expected-error at +1 {{'tosa.conv2d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.conv2d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = tosa.conv2d %arg0, %arg1, %arg2, %arg3, %arg3 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 1, 0, 1>, stride = array<i64: 8193, 1>} :
             (tensor<1x8194x33x8xf32>, tensor<16x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x2x33x16xf32>
   return %0 : tensor<1x2x33x16xf32>
@@ -620,7 +620,7 @@ func.func @test_conv2d_stride_y(%arg0: tensor<1x8194x33x8xf32>, %arg1: tensor<16
 // -----
 
 func.func @test_conv2d_stride_x(%arg0: tensor<1x33x8194x8xf32>, %arg1: tensor<16x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>) -> tensor<1x33x2x16xf32> {
-  // expected-error at +1 {{'tosa.conv2d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.conv2d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = tosa.conv2d %arg0, %arg1, %arg2, %arg3, %arg3 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 1, 0, 1>, stride = array<i64: 1, 8193>} :
             (tensor<1x33x8194x8xf32>, tensor<16x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x33x2x16xf32>
   return %0 : tensor<1x33x2x16xf32>
@@ -629,7 +629,7 @@ func.func @test_conv2d_stride_x(%arg0: tensor<1x33x8194x8xf32>, %arg1: tensor<16
 // -----
 
 func.func @test_conv3d_dilation_d(%arg0: tensor<1x8192x1x1x8xf32>, %arg1: tensor<16x1025x1x1x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x1x2x2x16xf32> {
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: dilation_d * KD <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: dilation_d * KD <= MAX_KERNEL (8192), got 8200}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 8, 1, 1>, pad = array<i64: 0, 1, 0, 1, 0, 1>, stride = array<i64: 1, 1, 1>} :
             (tensor<1x8192x1x1x8xf32>, tensor<16x1025x1x1x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x1x2x2x16xf32>
   return %0 : tensor<1x1x2x2x16xf32>
@@ -638,7 +638,7 @@ func.func @test_conv3d_dilation_d(%arg0: tensor<1x8192x1x1x8xf32>, %arg1: tensor
 // -----
 
 func.func @test_conv3d_dilation_y(%arg0: tensor<1x1x8192x1x8xf32>, %arg1: tensor<16x1x1025x1x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x2x1x2x16xf32> {
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: dilation_y * KH <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: dilation_y * KH <= MAX_KERNEL (8192), got 8200}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 8, 1>, pad = array<i64: 0, 1, 0, 1, 0, 1>, stride = array<i64: 1, 1, 1>} :
             (tensor<1x1x8192x1x8xf32>, tensor<16x1x1025x1x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x2x1x2x16xf32>
   return %0 : tensor<1x2x1x2x16xf32>
@@ -647,7 +647,7 @@ func.func @test_conv3d_dilation_y(%arg0: tensor<1x1x8192x1x8xf32>, %arg1: tensor
 // -----
 
 func.func @test_conv3d_dilation_x(%arg0: tensor<1x1x1x8192x8xf32>, %arg1: tensor<16x1x1x1025x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x2x2x1x16xf32> {
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: dilation_x * KW <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: dilation_x * KW <= MAX_KERNEL (8192), got 8200}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1, 8>, pad = array<i64: 0, 1, 0, 1, 0, 1>, stride = array<i64: 1, 1, 1>} :
             (tensor<1x1x1x8192x8xf32>, tensor<16x1x1x1025x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x2x2x1x16xf32>
   return %0 : tensor<1x2x2x1x16xf32>
@@ -656,7 +656,7 @@ func.func @test_conv3d_dilation_x(%arg0: tensor<1x1x1x8192x8xf32>, %arg1: tensor
 // -----
 
 func.func @test_conv3d_pad_d0(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16x2x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x8194x32x32x16xf32> {
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1, 1>, pad = array<i64: 8193, 1, 0, 1, 0, 1>, stride = array<i64: 1, 1, 1>} :
             (tensor<1x1x32x32x8xf32>, tensor<16x2x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x8194x32x32x16xf32>
   return %0 : tensor<1x8194x32x32x16xf32>
@@ -665,7 +665,7 @@ func.func @test_conv3d_pad_d0(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16x2
 // -----
 
 func.func @test_conv3d_pad_d1(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16x2x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x8194x32x32x16xf32> {
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1, 1>, pad = array<i64: 1, 8193, 0, 1, 0, 1>, stride = array<i64: 1, 1, 1>} :
             (tensor<1x1x32x32x8xf32>, tensor<16x2x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x8194x32x32x16xf32>
   return %0 : tensor<1x8194x32x32x16xf32>
@@ -674,7 +674,7 @@ func.func @test_conv3d_pad_d1(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16x2
 // -----
 
 func.func @test_conv3d_pad_top(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16x2x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x1x8225x32x16xf32> {
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1, 1>, pad = array<i64: 0, 1, 8193, 1, 0, 1>, stride = array<i64: 1, 1, 1>} :
             (tensor<1x1x32x32x8xf32>, tensor<16x2x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x1x8225x32x16xf32>
   return %0 : tensor<1x1x8225x32x16xf32>
@@ -683,7 +683,7 @@ func.func @test_conv3d_pad_top(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16x
 // -----
 
 func.func @test_conv3d_pad_bottom(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16x2x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x1x8224x32x16xf32> {
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1, 1>, pad = array<i64: 0, 1, 0, 8193, 0, 1>, stride = array<i64: 1, 1, 1>} :
             (tensor<1x1x32x32x8xf32>, tensor<16x2x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x1x8224x32x16xf32>
   return %0 : tensor<1x1x8224x32x16xf32>
@@ -692,7 +692,7 @@ func.func @test_conv3d_pad_bottom(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<
 // -----
 
 func.func @test_conv3d_pad_left(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16x2x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x1x32x8225x16xf32> {
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1, 1>, pad = array<i64: 0, 1, 0, 1, 8193, 1>, stride = array<i64: 1, 1, 1>} :
             (tensor<1x1x32x32x8xf32>, tensor<16x2x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x1x32x8225x16xf32>
   return %0 : tensor<1x1x32x8225x16xf32>
@@ -701,7 +701,7 @@ func.func @test_conv3d_pad_left(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16
 // -----
 
 func.func @test_conv3d_pad_right(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16x2x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x1x32x8224x16xf32> {
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1, 1>, pad = array<i64: 0, 1, 0, 1, 0, 8193>, stride = array<i64: 1, 1, 1>} :
             (tensor<1x1x32x32x8xf32>, tensor<16x2x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x1x32x8224x16xf32>
   return %0 : tensor<1x1x32x8224x16xf32>
@@ -710,7 +710,7 @@ func.func @test_conv3d_pad_right(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<1
 // -----
 
 func.func @test_conv3d_stride_d(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16x2x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x1x32x32x16xf32>{
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1, 1>, pad = array<i64: 0, 1, 0, 1, 0, 1>, stride = array<i64: 8193, 1, 1>} :
             (tensor<1x1x32x32x8xf32>, tensor<16x2x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x1x32x32x16xf32>
   return %0 : tensor<1x1x32x32x16xf32>
@@ -719,7 +719,7 @@ func.func @test_conv3d_stride_d(%arg0: tensor<1x1x32x32x8xf32>, %arg1: tensor<16
 // -----
 
 func.func @test_conv3d_stride_y(%arg0: tensor<1x1x8194x32x8xf32>, %arg1: tensor<16x2x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x1x2x32x16xf32> {
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1, 1>, pad = array<i64: 0, 1, 0, 1, 0, 1>, stride = array<i64: 1, 8193, 1>} :
             (tensor<1x1x8194x32x8xf32>, tensor<16x2x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x1x2x32x16xf32>
   return %0 : tensor<1x1x2x32x16xf32>
@@ -728,7 +728,7 @@ func.func @test_conv3d_stride_y(%arg0: tensor<1x1x8194x32x8xf32>, %arg1: tensor<
 // -----
 
 func.func @test_conv3d_stride_x(%arg0: tensor<1x1x32x8194x8xf32>, %arg1: tensor<16x2x2x2x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x1x32x2x16xf32> {
-  // expected-error at +1 {{'tosa.conv3d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.conv3d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1, 1>, pad = array<i64: 0, 1, 0, 1, 0, 1>, stride = array<i64: 1, 1, 8193>} :
             (tensor<1x1x32x8194x8xf32>, tensor<16x2x2x2x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x1x32x2x16xf32>
   return %0 : tensor<1x1x32x2x16xf32>
@@ -737,7 +737,7 @@ func.func @test_conv3d_stride_x(%arg0: tensor<1x1x32x8194x8xf32>, %arg1: tensor<
 // -----
 
 func.func @test_depthwise_conv2d_dilation_y(%arg0: tensor<1x8192x8192x4xf32>, %arg1: tensor<1025x16x4x1xf32>, %arg2: tensor<4xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x1x8178x4xf32> {
-  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: dilation_y * KH <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: dilation_y * KH <= MAX_KERNEL (8192), got 8200}}
   %0 = tosa.depthwise_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 8, 1>, pad = array<i64: 0, 1, 0, 1>, stride = array<i64: 1, 1>} :
             (tensor<1x8192x8192x4xf32>, tensor<1025x16x4x1xf32>, tensor<4xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x1x8178x4xf32>
   return %0 : tensor<1x1x8178x4xf32>
@@ -746,7 +746,7 @@ func.func @test_depthwise_conv2d_dilation_y(%arg0: tensor<1x8192x8192x4xf32>, %a
 // -----
 
 func.func @test_depthwise_conv2d_dilation_x(%arg0: tensor<1x8192x8192x4xf32>, %arg1: tensor<16x1025x4x1xf32>, %arg2: tensor<4xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x8178x1x4xf32> {
-  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: dilation_x * KW <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: dilation_x * KW <= MAX_KERNEL (8192), got 8200}}
   %0 = tosa.depthwise_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 8>, pad = array<i64: 0, 1, 0, 1>, stride = array<i64: 1, 1>} :
             (tensor<1x8192x8192x4xf32>, tensor<16x1025x4x1xf32>, tensor<4xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x8178x1x4xf32>
   return %0 : tensor<1x8178x1x4xf32>
@@ -755,7 +755,7 @@ func.func @test_depthwise_conv2d_dilation_x(%arg0: tensor<1x8192x8192x4xf32>, %a
 // -----
 
 func.func @test_depthwise_conv2d_pad_top(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<2x2x8x8xf32>, %arg2: tensor<64xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x8225x32x64xf32> {
-  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.depthwise_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 8193, 1, 0, 1>, stride = array<i64: 1, 1>} :
             (tensor<1x32x32x8xf32>, tensor<2x2x8x8xf32>, tensor<64xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x8225x32x64xf32>
   return %0 : tensor<1x8225x32x64xf32>
@@ -764,7 +764,7 @@ func.func @test_depthwise_conv2d_pad_top(%arg0: tensor<1x32x32x8xf32>, %arg1: te
 // -----
 
 func.func @test_depthwise_conv2d_pad_bottom(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<2x2x8x8xf32>, %arg2: tensor<64xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x8224x32x64xf32> {
-  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.depthwise_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 8193, 0, 1>, stride = array<i64: 1, 1>} :
             (tensor<1x32x32x8xf32>, tensor<2x2x8x8xf32>, tensor<64xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x8224x32x64xf32>
   return %0 : tensor<1x8224x32x64xf32>
@@ -774,7 +774,7 @@ func.func @test_depthwise_conv2d_pad_bottom(%arg0: tensor<1x32x32x8xf32>, %arg1:
 // -----
 
 func.func @test_depthwise_conv2d_pad_left(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<2x2x8x8xf32>, %arg2: tensor<64xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x32x8225x64xf32> {
-  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.depthwise_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 1, 8193, 1>, stride = array<i64: 1, 1>} :
             (tensor<1x32x32x8xf32>, tensor<2x2x8x8xf32>, tensor<64xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x8225x64xf32>
   return %0 : tensor<1x32x8225x64xf32>
@@ -783,7 +783,7 @@ func.func @test_depthwise_conv2d_pad_left(%arg0: tensor<1x32x32x8xf32>, %arg1: t
 // -----
 
 func.func @test_depthwise_conv2d_pad_right(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<2x2x8x8xf32>, %arg2: tensor<64xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x32x8224x64xf32> {
-  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.depthwise_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 1, 0, 8193>, stride = array<i64: 1, 1>} :
             (tensor<1x32x32x8xf32>, tensor<2x2x8x8xf32>, tensor<64xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x8224x64xf32>
   return %0 : tensor<1x32x8224x64xf32>
@@ -792,7 +792,7 @@ func.func @test_depthwise_conv2d_pad_right(%arg0: tensor<1x32x32x8xf32>, %arg1:
 // -----
 
 func.func @test_depthwise_conv2d_stride_y(%arg0: tensor<1x8194x32x8xf32>, %arg1: tensor<2x2x8x8xf32>, %arg2: tensor<64xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x2x32x64xf32> {
-  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = tosa.depthwise_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 1, 0, 1>, stride = array<i64: 8193, 1>} :
             (tensor<1x8194x32x8xf32>, tensor<2x2x8x8xf32>, tensor<64xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x2x32x64xf32>
   return %0 : tensor<1x2x32x64xf32>
@@ -801,7 +801,7 @@ func.func @test_depthwise_conv2d_stride_y(%arg0: tensor<1x8194x32x8xf32>, %arg1:
 // -----
 
 func.func @test_depthwise_conv2d_stride_x(%arg0: tensor<1x32x8194x8xf32>, %arg1: tensor<2x2x8x8xf32>, %arg2: tensor<64xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x32x2x64xf32> {
-  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.depthwise_conv2d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = tosa.depthwise_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 1, 0, 1>, stride = array<i64: 1, 8193>} :
             (tensor<1x32x8194x8xf32>, tensor<2x2x8x8xf32>, tensor<64xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x2x64xf32>
   return %0 : tensor<1x32x2x64xf32>
@@ -810,7 +810,7 @@ func.func @test_depthwise_conv2d_stride_x(%arg0: tensor<1x32x8194x8xf32>, %arg1:
 // -----
 
 func.func @test_fft2d_real_h(%arg0: tensor<32x16384x32xf32>, %arg1: tensor<32x16384x32xf32>) -> (tensor<32x16384x32xf32>, tensor<32x16384x32xf32>) {
-  // expected-error at +1 {{'tosa.fft2d' op failed level check: H <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.fft2d' op failed level check: H <= MAX_KERNEL (8192), got 16384}}
   %0, %1 = "tosa.fft2d"(%arg0, %arg1) { inverse = false } :
             (tensor<32x16384x32xf32>, tensor<32x16384x32xf32>) -> (tensor<32x16384x32xf32>, tensor<32x16384x32xf32>)
   return %0, %1 : tensor<32x16384x32xf32>, tensor<32x16384x32xf32>
@@ -819,7 +819,7 @@ func.func @test_fft2d_real_h(%arg0: tensor<32x16384x32xf32>, %arg1: tensor<32x16
 // -----
 
 func.func @test_fft2d_real_w(%arg0: tensor<32x32x16384xf32>, %arg1: tensor<32x32x16384xf32>) -> (tensor<32x32x16384xf32>, tensor<32x32x16384xf32>) {
-  // expected-error at +1 {{'tosa.fft2d' op failed level check: W <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.fft2d' op failed level check: W <= MAX_KERNEL (8192), got 16384}}
   %0, %1 = "tosa.fft2d"(%arg0, %arg1) { inverse = false } :
             (tensor<32x32x16384xf32>, tensor<32x32x16384xf32>) -> (tensor<32x32x16384xf32>, tensor<32x32x16384xf32>)
   return %0, %1 : tensor<32x32x16384xf32>, tensor<32x32x16384xf32>
@@ -828,7 +828,7 @@ func.func @test_fft2d_real_w(%arg0: tensor<32x32x16384xf32>, %arg1: tensor<32x32
 // -----
 
 func.func @test_fft2d_imag_h(%arg0: tensor<32x16384x32xf32>, %arg1: tensor<32x16384x32xf32>) -> (tensor<32x16384x32xf32>, tensor<32x16384x32xf32>) {
-  // expected-error at +1 {{'tosa.fft2d' op failed level check: H <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.fft2d' op failed level check: H <= MAX_KERNEL (8192), got 16384}}
   %0, %1 = "tosa.fft2d"(%arg0, %arg1) { inverse = false } :
             (tensor<32x16384x32xf32>, tensor<32x16384x32xf32>) -> (tensor<32x16384x32xf32>, tensor<32x16384x32xf32>)
   return %0, %1 : tensor<32x16384x32xf32>, tensor<32x16384x32xf32>
@@ -837,7 +837,7 @@ func.func @test_fft2d_imag_h(%arg0: tensor<32x16384x32xf32>, %arg1: tensor<32x16
 // -----
 
 func.func @test_fft2d_imag_w(%arg0: tensor<32x32x16384xf32>, %arg1: tensor<32x32x16384xf32>) -> (tensor<32x32x16384xf32>, tensor<32x32x16384xf32>) {
-  // expected-error at +1 {{'tosa.fft2d' op failed level check: W <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.fft2d' op failed level check: W <= MAX_KERNEL (8192), got 16384}}
   %0, %1 = "tosa.fft2d"(%arg0, %arg1) { inverse = false } :
             (tensor<32x32x16384xf32>, tensor<32x32x16384xf32>) -> (tensor<32x32x16384xf32>, tensor<32x32x16384xf32>)
   return %0, %1 : tensor<32x32x16384xf32>, tensor<32x32x16384xf32>
@@ -846,7 +846,7 @@ func.func @test_fft2d_imag_w(%arg0: tensor<32x32x16384xf32>, %arg1: tensor<32x32
 // -----
 
 func.func @test_maxpool2d_kernel_y(%arg0: tensor<1x8194x32x8xf32>) -> tensor<1x2x32x8xf32> {
-  // expected-error at +1 {{'tosa.max_pool2d' op failed level check: kernel <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.max_pool2d' op failed level check: kernel <= MAX_KERNEL (8192), got 8193}}
   %0 = "tosa.max_pool2d"(%arg0) {kernel = array<i64: 8193, 1>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>} :
          (tensor<1x8194x32x8xf32>) -> tensor<1x2x32x8xf32>
   return %0 : tensor<1x2x32x8xf32>
@@ -855,7 +855,7 @@ func.func @test_maxpool2d_kernel_y(%arg0: tensor<1x8194x32x8xf32>) -> tensor<1x2
 // -----
 
 func.func @test_maxpool2d_kernel_x(%arg0: tensor<1x32x8194x8xf32>) -> tensor<1x32x2x8xf32> {
-  // expected-error at +1 {{'tosa.max_pool2d' op failed level check: kernel <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.max_pool2d' op failed level check: kernel <= MAX_KERNEL (8192), got 8193}}
   %0 = "tosa.max_pool2d"(%arg0) {kernel = array<i64: 1, 8193>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>} :
          (tensor<1x32x8194x8xf32>) -> tensor<1x32x2x8xf32>
   return %0 : tensor<1x32x2x8xf32>
@@ -864,7 +864,7 @@ func.func @test_maxpool2d_kernel_x(%arg0: tensor<1x32x8194x8xf32>) -> tensor<1x3
 // -----
 
 func.func @test_maxpool2d_stride_y(%arg0: tensor<1x8194x32x8xf32>) -> tensor<1x2x32x8xf32> {
-  // expected-error at +1 {{'tosa.max_pool2d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.max_pool2d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = "tosa.max_pool2d"(%arg0) {kernel = array<i64: 1, 1>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 8193, 1>} :
          (tensor<1x8194x32x8xf32>) -> tensor<1x2x32x8xf32>
   return %0 : tensor<1x2x32x8xf32>
@@ -873,7 +873,7 @@ func.func @test_maxpool2d_stride_y(%arg0: tensor<1x8194x32x8xf32>) -> tensor<1x2
 // -----
 
 func.func @test_maxpool2d_stride_x(%arg0: tensor<1x32x8194x8xf32>) -> tensor<1x32x2x8xf32> {
-  // expected-error at +1 {{'tosa.max_pool2d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.max_pool2d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = "tosa.max_pool2d"(%arg0) {kernel = array<i64: 1, 1>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 8193>} :
          (tensor<1x32x8194x8xf32>) -> tensor<1x32x2x8xf32>
   return %0 : tensor<1x32x2x8xf32>
@@ -882,7 +882,7 @@ func.func @test_maxpool2d_stride_x(%arg0: tensor<1x32x8194x8xf32>) -> tensor<1x3
 // -----
 
 func.func @test_rfft2d_input_h(%arg0: tensor<13x16384x16xf32>) -> (tensor<13x16384x9xf32>, tensor<13x16384x9xf32>) {
-  // expected-error at +1 {{'tosa.rfft2d' op failed level check: H <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.rfft2d' op failed level check: H <= MAX_KERNEL (8192), got 16384}}
   %0, %1 = "tosa.rfft2d"(%arg0) {} : (tensor<13x16384x16xf32>) -> (tensor<13x16384x9xf32>, tensor<13x16384x9xf32>)
   return %0, %1 : tensor<13x16384x9xf32>, tensor<13x16384x9xf32>
 }
@@ -890,7 +890,7 @@ func.func @test_rfft2d_input_h(%arg0: tensor<13x16384x16xf32>) -> (tensor<13x163
 // -----
 
 func.func @test_rfft2d_input_w(%arg0: tensor<13x8x16384xf32>) -> (tensor<13x8x8193xf32>, tensor<13x8x8193xf32>) {
-  // expected-error at +1 {{'tosa.rfft2d' op failed level check: W <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.rfft2d' op failed level check: W <= MAX_KERNEL (8192), got 16384}}
   %0, %1 = "tosa.rfft2d"(%arg0) {} : (tensor<13x8x16384xf32>) -> (tensor<13x8x8193xf32>, tensor<13x8x8193xf32>)
   return %0, %1 : tensor<13x8x8193xf32>, tensor<13x8x8193xf32>
 }
@@ -898,7 +898,7 @@ func.func @test_rfft2d_input_w(%arg0: tensor<13x8x16384xf32>) -> (tensor<13x8x81
 // -----
 
 func.func @test_transpose_conv2d_weight_h(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x8193x1x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x8224x32x16xf32> {
-  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: KH <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: KH <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.transpose_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, out_pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>} :
               (tensor<1x32x32x8xf32>, tensor<16x8193x1x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x8224x32x16xf32>
   return %0 : tensor<1x8224x32x16xf32>
@@ -907,7 +907,7 @@ func.func @test_transpose_conv2d_weight_h(%arg0: tensor<1x32x32x8xf32>, %arg1: t
 // -----
 
 func.func @test_transpose_conv2d_weight_w(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x1x8193x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x32x8224x16xf32> {
-  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: KW <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: KW <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.transpose_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, out_pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>} :
               (tensor<1x32x32x8xf32>, tensor<16x1x8193x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x8224x16xf32>
   return %0 : tensor<1x32x8224x16xf32>
@@ -916,7 +916,7 @@ func.func @test_transpose_conv2d_weight_w(%arg0: tensor<1x32x32x8xf32>, %arg1: t
 // -----
 
 func.func @test_transpose_conv2d_pad_top(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x1x1x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x8225x32x16xf32> {
-  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.transpose_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, out_pad = array<i64: 8193, 0, 0, 0>, stride = array<i64: 1, 1>} :
               (tensor<1x32x32x8xf32>, tensor<16x1x1x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x8225x32x16xf32>
   return %0 : tensor<1x8225x32x16xf32>
@@ -925,7 +925,7 @@ func.func @test_transpose_conv2d_pad_top(%arg0: tensor<1x32x32x8xf32>, %arg1: te
 // -----
 
 func.func @test_transpose_conv2d_pad_bottom(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x1x1x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x8225x32x16xf32> {
-  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.transpose_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, out_pad = array<i64: 0, 8193, 0, 0>, stride = array<i64: 1, 1>} :
               (tensor<1x32x32x8xf32>, tensor<16x1x1x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x8225x32x16xf32>
   return %0 : tensor<1x8225x32x16xf32>
@@ -934,7 +934,7 @@ func.func @test_transpose_conv2d_pad_bottom(%arg0: tensor<1x32x32x8xf32>, %arg1:
 // -----
 
 func.func @test_transpose_conv2d_pad_left(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x1x1x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x32x8225x16xf32> {
-  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.transpose_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, out_pad = array<i64: 0, 0, 8193, 0>, stride = array<i64: 1, 1>} :
               (tensor<1x32x32x8xf32>, tensor<16x1x1x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x8225x16xf32>
   return %0 : tensor<1x32x8225x16xf32>
@@ -943,7 +943,7 @@ func.func @test_transpose_conv2d_pad_left(%arg0: tensor<1x32x32x8xf32>, %arg1: t
 // -----
 
 func.func @test_transpose_conv2d_pad_right(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x1x1x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x32x8225x16xf32> {
-  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: pad <= MAX_KERNEL}}
+  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: pad <= MAX_KERNEL (8192), got 8193}}
   %0 = tosa.transpose_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, out_pad = array<i64: 0, 0, 0, 8193>, stride = array<i64: 1, 1>} :
               (tensor<1x32x32x8xf32>, tensor<16x1x1x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x8225x16xf32>
   return %0 : tensor<1x32x8225x16xf32>
@@ -952,7 +952,7 @@ func.func @test_transpose_conv2d_pad_right(%arg0: tensor<1x32x32x8xf32>, %arg1:
 // -----
 
 func.func @test_transpose_conv2d_stride_y(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x1x1x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x253984x32x16xf32> {
-  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = tosa.transpose_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, out_pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 8193, 1>} :
               (tensor<1x32x32x8xf32>, tensor<16x1x1x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x253984x32x16xf32>
   return %0 : tensor<1x253984x32x16xf32>
@@ -961,7 +961,7 @@ func.func @test_transpose_conv2d_stride_y(%arg0: tensor<1x32x32x8xf32>, %arg1: t
 // -----
 
 func.func @test_transpose_conv2d_stride_x(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x1x1x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x32x253984x16xf32> {
-  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: stride <= MAX_STRIDE}}
+  // expected-error at +1 {{'tosa.transpose_conv2d' op failed level check: stride <= MAX_STRIDE (8192), got 8193}}
   %0 = tosa.transpose_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, out_pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 8193>} :
               (tensor<1x32x32x8xf32>, tensor<16x1x1x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x253984x16xf32>
   return %0 : tensor<1x32x253984x16xf32>
@@ -973,7 +973,7 @@ func.func @test_resize_scale_y(%arg0: tensor<1x32x32x8xf32>) -> tensor<1x7970x64
   %scale = tosa.const_shape { values = dense<[257, 1, 4, 2]> : tensor<4xindex> } : () -> !tosa.shape<4>
   %offset = tosa.const_shape { values = dense<[-1, -1]> : tensor<2xindex> } : () -> !tosa.shape<2>
   %border = tosa.const_shape { values = dense<[1, 1]> : tensor<2xindex> } : () -> !tosa.shape<2>
-  // expected-error at +1 {{'tosa.resize' op failed level check: scale_y_n/scale_y_d <= MAX_SCALE}}
+  // expected-error at +1 {{'tosa.resize' op failed level check: scale_y_n/scale_y_d <= MAX_SCALE (256), got 257}}
   %1 = tosa.resize %arg0, %scale, %offset, %border {mode = BILINEAR} :
                 (tensor<1x32x32x8xf32>, !tosa.shape<4>, !tosa.shape<2>, !tosa.shape<2>) -> tensor<1x7970x64x8xf32>
   return %1 : tensor<1x7970x64x8xf32>
@@ -985,7 +985,7 @@ func.func @test_resize_scale_x(%arg0: tensor<1x32x32x8xf32>) -> tensor<1x64x7970
   %scale = tosa.const_shape { values = dense<[4, 2, 257, 1]> : tensor<4xindex> } : () -> !tosa.shape<4>
   %offset = tosa.const_shape { values = dense<[-1, -1]> : tensor<2xindex> } : () -> !tosa.shape<2>
   %border = tosa.const_shape { values = dense<[1, 1]> : tensor<2xindex> } : () -> !tosa.shape<2>
-  // expected-error at +1 {{'tosa.resize' op failed level check: scale_x_n/scale_x_d <= MAX_SCALE}}
+  // expected-error at +1 {{'tosa.resize' op failed level check: scale_x_n/scale_x_d <= MAX_SCALE (256), got 257}}
   %1 = tosa.resize %arg0, %scale, %offset, %border {mode = BILINEAR} :
                 (tensor<1x32x32x8xf32>, !tosa.shape<4>, !tosa.shape<2>, !tosa.shape<2>) -> tensor<1x64x7970x8xf32>
   return %1 : tensor<1x64x7970x8xf32>
@@ -1261,7 +1261,7 @@ func.func @test_tensor_size_ok(%arg0: tensor<1x536870911xf32>) {
 // CHECK-LABEL: test_concat_tensor_list_size
 func.func @test_concat_tensor_list_size() {
   %0 = "tosa.const"() {values = dense<0> : tensor<1xi32>} : () -> tensor<1xi32>
-  // expected-error at +1 {{'tosa.concat' op failed level check for MAX_TENSOR_LIST_SIZE: input1}}
+  // expected-error at +1 {{'tosa.concat' op failed level check: length(tensor_list_shape(input1)) <= MAX_TENSOR_LIST_SIZE (64), got 65}}
   %1= tosa.concat %0, %0, %0, %0, %0, %0, %0, %0,
                   %0, %0, %0, %0, %0, %0, %0, %0,
                   %0, %0, %0, %0, %0, %0, %0, %0,
@@ -1290,7 +1290,7 @@ func.func @test_concat_tensor_list_size() {
 // CHECK-LABEL: test_custom_tensor_list_size
 func.func @test_custom_tensor_list_size() {
   %0 = "tosa.const"() {values = dense<0> : tensor<1xi32>} : () -> tensor<1xi32>
-  // expected-error at +1 {{'tosa.custom' op failed level check for MAX_TENSOR_LIST_SIZE: input_list}}
+  // expected-error at +1 {{'tosa.custom' op failed level check: length(tensor_list_shape(input_list)) <= MAX_TENSOR_LIST_SIZE (64), got 65}}
   %1= tosa.custom %0, %0, %0, %0, %0, %0, %0, %0,
                   %0, %0, %0, %0, %0, %0, %0, %0,
                   %0, %0, %0, %0, %0, %0, %0, %0,
@@ -1320,7 +1320,7 @@ func.func @test_custom_tensor_list_size() {
 func.func @test_custom_tensor_list_size_results() {
   %0 = "tosa.const"() {values = dense<0> : tensor<1xi32>} : () -> tensor<1xi32>
 
-  // expected-error at +1 {{'tosa.custom' op failed level check for MAX_TENSOR_LIST_SIZE: output_list}}
+  // expected-error at +1 {{'tosa.custom' op failed level check: length(tensor_list_shape(output_list)) <= MAX_TENSOR_LIST_SIZE (64), got 65}}
   %r:65 = tosa.custom %0 { domain_name = "tosa_mlir_test", operator_name = "custom_test", implementation_attrs = "" }:
                   ( tensor<1xi32> )
                   -> (
@@ -1342,7 +1342,7 @@ func.func @test_custom_tensor_list_size_results() {
 // CHECK-LABEL: test_if_tensor_list_size
 func.func @test_if_tensor_list_size(%arg0 : tensor<i1>) {
   %0 = "tosa.const"() {values = dense<0> : tensor<1xi32>} : () -> tensor<1xi32>
-  // expected-error at +1 {{'tosa.cond_if' op failed level check for MAX_TENSOR_LIST_SIZE: inputs}}
+  // expected-error at +1 {{'tosa.cond_if' op failed level check: length(tensor_list_shape(inputs)) <= MAX_TENSOR_LIST_SIZE (64), got 65}}
   %1 = "tosa.cond_if"(%arg0,   // condition
                   %0, %0, %0, %0, %0, %0, %0, %0, %0, %0,
                   %0, %0, %0, %0, %0, %0, %0, %0, %0, %0,
@@ -1389,7 +1389,7 @@ func.func @test_if_tensor_list_size(%arg0 : tensor<i1>) {
 func.func @test_if_tensor_list_size_outputs(%arg0 : tensor<i1>) {
   %cst_0 = "tosa.const"() {values = dense<0> : tensor<1xi32>} : () -> tensor<1xi32>
 
-  // expected-error at +1 {{'tosa.cond_if' op failed level check for MAX_TENSOR_LIST_SIZE: outputs}}
+  // expected-error at +1 {{'tosa.cond_if' op failed level check: length(tensor_list_shape(outputs)) <= MAX_TENSOR_LIST_SIZE (64), got 65}}
   %r:65 = "tosa.cond_if"(%arg0, %cst_0) ({
   ^bb0(%0: tensor<1xi32>):
     "tosa.yield"(%0, %0, %0, %0, %0, %0, %0, %0, %0, %0,
@@ -1443,7 +1443,7 @@ func.func @test_if_tensor_list_size_outputs(%arg0 : tensor<i1>) {
 // CHECK-LABEL: test_while_tensor_list_size
 func.func @test_while_tensor_list_size(%arg0: tensor<1x1x1x1x1x1x1xf32>, %arg1: tensor<1xi32>) {
   %0 = "tosa.const"() {values = dense<0> : tensor<1xi32>} : () -> tensor<1xi32>
-  // expected-error at +1 {{'tosa.while_loop' op failed level check for MAX_TENSOR_LIST_SIZE: inputs}}
+  // expected-error at +1 {{'tosa.while_loop' op failed level check: length(tensor_list_shape(inputs)) <= MAX_TENSOR_LIST_SIZE (64), got 65}}
   %1:65 = "tosa.while_loop"(%0, %arg0,
                   %0, %0, %0, %0, %0, %0, %0, %0, %0, %0,
                   %0, %0, %0, %0, %0, %0, %0, %0, %0, %0,
@@ -1526,7 +1526,7 @@ func.func @test_cond_if_max_nested_depth(%arg0: tensor<f32>, %arg1: tensor<f32>,
       %2 = tosa.cond_if %arg2 : tensor<i1> -> tensor<f32> {
         %3 = tosa.cond_if %arg3 : tensor<i1> -> tensor<f32> {
           %4 = tosa.cond_if %arg2 : tensor<i1>  -> tensor<f32> {
-            // expected-error at +1 {{'tosa.cond_if' op failed level check: 6 >= MAX_NESTING}}
+            // expected-error at +1 {{'tosa.cond_if' op failed level check: tosa_nesting_depth < MAX_NESTING (6), got 6}}
             %5 = tosa.cond_if %arg3 : tensor<i1> -> tensor<f32> {
               %res = tosa.sub %arg0, %arg1 : (tensor<f32>, tensor<f32>) -> tensor<f32>
               tosa.yield %res : tensor<f32>
@@ -1588,7 +1588,7 @@ func.func @test_while_loop_max_nested_depth(%arg0: tensor<i32>) {
             tosa.yield %2 : tensor<i1>
           } do {
           ^bb0(%arg10: tensor<i32>, %arg10b: tensor<i32>):
-            // expected-error at +1 {{'tosa.while_loop' op failed level check: 6 >= MAX_NESTING}}
+            // expected-error at +1 {{'tosa.while_loop' op failed level check: tosa_nesting_depth < MAX_NESTING (6), got 6}}
             %1:2 = tosa.while_loop (%arg12 = %init_0, %arg13 = %arg0) : (tensor<i32>, tensor<i32>) -> (tensor<i32>, tensor<i32>) {
               %2 = tosa.greater_equal %arg13, %arg12 : (tensor<i32>, tensor<i32>) -> tensor<i1>
               tosa.yield %2 : tensor<i1>

>From 6346fe58d6eb7836d6abe74de8b6bf6bed835e6d Mon Sep 17 00:00:00 2001
From: Luke Hutton <luke.hutton at arm.com>
Date: Tue, 27 Jan 2026 16:13:40 +0000
Subject: [PATCH 2/2] Fix test error message

Change-Id: I3d3f620218b6b57a8b6a25c2b4f39e6ac1e97532
---
 mlir/test/Dialect/Tosa/level_check.mlir | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/test/Dialect/Tosa/level_check.mlir b/mlir/test/Dialect/Tosa/level_check.mlir
index 5375cbb5cbc0d..216f05a484927 100644
--- a/mlir/test/Dialect/Tosa/level_check.mlir
+++ b/mlir/test/Dialect/Tosa/level_check.mlir
@@ -1695,7 +1695,7 @@ func.func @test_dim(%arg0: tensor<1x2x3x4x5x6x7x8xi32>) -> !tosa.shape<1> {
 
 func.func @test_concat_shape_invalid_list_size() {
   %0 = tosa.const_shape {values = dense<[]> : tensor<0xindex>} : () -> !tosa.shape<0>
-  // expected-error at +1 {{'tosa.concat_shape' op failed level check for MAX_TENSOR_LIST_SIZE: input}}
+  // expected-error at +1 {{'tosa.concat_shape' op failed level check: length(tensor_list_shape(input)) <= MAX_TENSOR_LIST_SIZE (64), got 65}}
   %1 = tosa.concat_shape %0, %0, %0, %0, %0, %0, %0, %0,
                          %0, %0, %0, %0, %0, %0, %0, %0,
                          %0, %0, %0, %0, %0, %0, %0, %0,



More information about the Mlir-commits mailing list