The GitHub Actions job "mainline-only" on tvm-ffi.git/main has failed.
Run started by GitHub user tqchen (triggered by tqchen).

Head commit for run:
a6071f671364563012cd830c98d6df1d935f880f / Tianqi Chen 
<[email protected]>
[EXTRA][FEAT] VisitErrorContext for visit-context-aware error reporting (#587)

## Summary

Introduces `VisitErrorContext`, a typed payload for
`Error::extra_context` that records the chain of `ObjectRef` nodes
visited during a recursive visit when an error is thrown. This enables
visit-context-aware error reporting with structured access paths.

### Key components

- **`VisitErrorContextObj` / `VisitErrorContext`**
(`include/tvm/ffi/extra/visit_error_context.h`): Object/Ref pair that
stores `reverse_visit_pattern` (the breadcrumb chain of visited nodes,
innermost-first) and `prev_error_context` (any pre-existing error
context that was displaced).

- **Macros** for instrumenting recursive visits:
- `TVM_FFI_VISIT_BEGIN()` / `TVM_FFI_VISIT_END(node)`: Wrap a visit body
in a try/catch that appends `node` to the error context on unwind.
- `TVM_FFI_VISIT_THROW(ErrorKind, node)`: Throw an error with `node` as
the innermost frame of the context (for pinpointing a child field as the
error site).

- **`VisitErrorContext::FindAccessPaths(root, ctx)`**: Resolves the
breadcrumb chain against a tree rooted at `root`, producing
`reflection::AccessPath` instances (e.g., `.body[2].cond.lhs`) for
richer error messages.

- **`VisitErrorAccessPathFinder`** (internal, in `.cc`): DFS matcher
that walks the tree using reflection field info, matching the breadcrumb
pattern with support for Attr/ArrayItem/MapItem access kinds, CSE
multi-match, sparse anchors, prefix matching, and
consecutive-duplicate/null cleanup.

### Tests

Comprehensive GoogleTest coverage in
`tests/cpp/extra/test_visit_error_context.cc`:
- Layer A (Macro to Chain): `MacroBuildsChain`,
`MacroPreExistingPayloadWrap`, `MacroThrowBuildsChain`
- Layer B (Chain to AccessPaths): `BasicMatch`, `AccessKindCoverage`,
`SparsePatternAnchors`, `PartialChain`, `EdgeCases`, `RecordsCleanup`
- Integration: `TryGetFromError`

Report URL: https://github.com/apache/tvm-ffi/actions/runs/26254351997

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to