Skip to content

Load and store trace packets should respect access predicates #9504

Open

Description

@alexreinking

This text was written by a machine (GitHub Copilot), not by the PR author.

Description

Tracking the bug Andrew Adams requested while reviewing PR #9476: load and store trace packets ignore the access predicate. A trace should describe the accesses actually performed, not report inactive accesses or lanes.

Originating review comment

Source: #9476 (comment)

Issues to open:
bug: load and store trace packets ignore the predicate
enhancement: use predicated calls for zero boundary conditions

Reproducing case / code evidence

In PR #9476, src/Tracing.cpp, InjectTracing::visit(const Call *) builds a halide_trace_load event and wraps the load in Let(value, call, return_second(trace, value)). The trace does not inherit the load Call's predicate: a skipped Call produces zero, but still gets traced. The store visitor applies a predicate to the trace Call, but trace packets also need to faithfully represent active lanes after vectorization rather than advertising every lane as accessed.

This is a review-requested tracking issue; a standalone runtime reproducer has not been independently validated here. Regression coverage should include scalar and vector loads and stores with false/mixed predicates, checking emitted events and coordinates against actual memory accesses.

Expected resolution

Preserve access predicates through tracing and vectorization, and represent/filter inactive lanes appropriately in the emitted packets. Keep trace value evaluation ordered correctly and avoid re-evaluating side effects.

Additional context

Built-from-source PR #9476, reviewed at commit 7217e690970301666ba5dbe03eb84548b6c0dff6. This follow-up is separate from the predicated-Calls implementation review fixes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions