Skip to main content

Halidoscope

An interactive GUI and CLI for working with Halide traces.

Prerequisites

You'll need a few prerequisites to get everything working.

  1. Tauri's system dependencies for your OS.
    • Note that you only need dependencies for desktop targets.
  2. A Rust installation.
  3. A Node.js installation.
  4. PNPM, a space-efficient package manager for the JavaScript ecosystem.

Installing Halidoscope

The easiest way to get halidoscope on your PATH is via pip:

pip install halidoscope

This installs a prebuilt binary wheel containing both the GUI and the CLI. Note that pip cannot install the system webview Halidoscope's GUI renders into (WebKitGTK on Linux, WebView2 on Windows, WKWebView on macOS), so Tauri's system dependencies must be present on Linux; macOS and Windows ship a compatible webview out of the box. Currently, halidoscope initializes its windowing toolkit unconditionally on startup, so on Linux this applies even to the non-interactive CLI subcommands (list, stats, dot, snapshot) -- running any of them on a Linux host with no display attached (e.g., a headless CI runner or container) additionally requires a virtual display such as Xvfb.

Building Halidoscope

To get a production build locally, run the following two commands:

pnpm install
pnpm tauri build

This will write the Halidoscope executable to tools/halidoscope/src-tauri/target/release/halidoscope. You can, of course, symlink this executable to any directory on your PATH. On Unix systems:

ln -sf tools/halidoscope/src-tauri/target/release/halidoscope /some/dir/on/your/path/halidoscope

Building the pip package locally

Halidoscope's wheel is built with maturin, which compiles src-tauri's halidoscope binary and packages it directly (no Python extension module involved). The frontend must be built first, since the binary embeds dist/ at compile time:

pnpm install
pnpm build
pip install maturin
maturin build --release

pyproject.toml enables the tauri/custom-protocol Cargo feature for this build. Without it, the compiled binary always tries to load its UI from Tauri's dev server instead of the files embedded from dist/, so the resulting wheel's GUI can't launch outside of pnpm tauri dev.

Using Halidoscope

Calling Halidoscope from a Halide program

Halide exposes a member function on the Pipeline class, Pipeline::halidoscope, that allows you to launch Halidoscope directly from an executing program. This call will execute the your pipeline once with tracing enabled, once with profiling enabled, and then launch an interactive Halidoscope session.

// Normal algorithm definition and scheduling code.

// Create the pipeline.
Pipeline pipeline(output);

// Example call where we explicitly pass the size of output buffer we want
// Halidoscope to allocate. In this case, we want to match to the dimensions of
// our input buffer exactly.
std::vector<int32_t> sizes = {input.width(), input.height(), input.channels()};
pipeline.halidoscope(sizes);

The first argument to Pipeline::halidoscope matches that of Pipeline::realize and can be one of:

  1. A sizes std::vector<int32_t> defining the dimensionality of output buffers for Halidoscope (and, under the hood, the Halide runtime) to allocate.
  2. An output RealizationArg representing an already-allocated destination (e.g., a Buffer) for Halidoscope to write to.

As with Pipeline::realize, either may be preceded by a JITUserContext *.

Calling Halidoscope from a Generator

Generators have a protected halidoscope member function that can be called from generate() once all outputs are defined. It takes the same arguments as the Callable returned by compile_to_callable: an optional JITUserContext *, then the inputs in order, then the output buffers. The inputs are bound to the Generator's input parameters and get_pipeline() is passed to Pipeline::halidoscope. A HalidoscopeOptions may be passed as the very first argument.

void generate() {
    // Define and schedule the outputs.

    Buffer<float> input_buffer = Halide::Tools::load_and_convert_image("input.png");
    Buffer<float> output_buffer(input_buffer.width(), input_buffer.height());
    halidoscope(input_buffer, 0.5f, output_buffer);
}

Configuring Halidoscope's behavior

The Pipeline::halidoscope API also accepts an options argument of type HalidoscopeOptions that can control how Halidoscope behaves. This struct has the following shape:

Field Type Description
path std::optional<std::string> The path to the Halidoscope binary on disk. By default, Pipeline::halidoscope will look for halidoscope on the user's $PATH and error if not found.
output_dir std::optional<std::string> (Optional.) A path to a non-volatile directory for storing Halidoscope-generated trace binaries and profiler output. By default, Halidoscope will write recorded .hltrace and profile JSON files to a temporary directory that is destroyed on process exit.
profile_runs std::optional<int> The number of profiling runs for the Halide profiler to execute on the pipeline. If unset, runs the pipeline repeatedly for at least one second (not counting the first run, which includes JIT compilation). Users can opt out of profiling altogether by specifying 0.
trace_file_size_limit size_t A limit on the size of the compressed trace file, in megabytes (default 1000). If the trace exceeds it, Pipeline::halidoscope fails with an error rather than filling the disk.

Calling Halidoscope from the command line

As an alternative to the Pipeline::halidoscope API, you can also invoke Halidoscope directly from the command line to launch the GUI. To work with a pre-recorded trace, simply specify the path to a Halide trace binary file via the --trace flag. Traces may be raw (e.g. as written by HL_TRACE_FILE) or compressed (as written by Pipeline::halidoscope, using tools/halide_trace_compression.h).

halidoscope --trace <path/to/file.hltrace>

If you'd also like to visualize a pre-recorded profile JSON file, pass the path to that file via the --profile flag. Note that --trace is always required.

halidoscope --trace <path/to/file.hltrace> --profile <path/to/profile.json>

Additional CLI commands

halidoscope also exposes a non-interactive CLI for gathering information about your Halide pipeline.

list

List the Funcs in a trace, along with their dimensionality.

halidoscope list --trace <path/to/file.hltrace> [--json]
  • -t, --trace <path> (required): Path to the .hltrace file to analyze.
  • --json: Print output as JSON instead of a table.

stats

Print statistics (minimum/maximum coordinates, minimum/maximum value, maximum store/load counts, and thread count) for one or all Funcs in a trace.

halidoscope stats --trace <path/to/file.hltrace> [--func <name>] [--json]
  • -t, --trace <path> (required): Path to the .hltrace file to analyze.
  • -f, --func <name>: Name of the Func to print statistics for. If omitted, prints statistics for all Funcs.
  • --json: Print output as JSON instead of a table.

dot

Generate a Graphviz DOT representation of the pipeline's dataflow graph.

halidoscope dot --trace <path/to/file.hltrace> [destination]
  • -t, --trace <path> (required): Path to the .hltrace file to analyze.
  • destination (optional): Path to write the DOT file. Must end in .txt, .gv, or .dot. If omitted, prints the DOT source to stdout.

snapshot

Snapshot a Func's values at a given packet index for a given render mode, writing the underlying data to a JSON file.

halidoscope snapshot --trace <path/to/file.hltrace> --func <name> [--packet-index <n>] [--mode <mode>] <destination>
  • -t, --trace <path> (required): Path to the .hltrace file to snapshot.
  • -f, --func <name> (required): Name of the Func to snapshot.
  • -i, --packet-index <n>: Global packet index to snapshot. Defaults to 0.
  • -m, --mode <mode>: Rendering mode. One of grayscale (default), rgb store-frequency, load-frequency, redundant-stores, or reuse-distance.
  • destination (required): Path to write the output snapshot. Must end in .json.

Developing Halidoscope

Developing Halidoscope locally should be fairly straightforward. Assuming you've installed the prequisities, just run the following two commands.

pnpm install
pnpm tauri dev -- -- --trace <path/to/file.hltrace> [--profile <path/to/profile.json>]

These commands will install all necessary JavaScript and Rust dependencies, build the Rust backend (using the dev profile), and start Vite's dev server. Changes on both the Rust and TypeScript sides will trigger automatic rebuilds with hot reloading — no need to stop your dev server while developing!

Metadata

Release files for halidoscope 22.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for halidoscope 22.0.0
File Actions
halidoscope-22.0.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for halidoscope-22.0.0-py3-none-win_amd64.whl
halidoscope-22.0.0-py3-none-manylinux_2_39_x86_64.whl Python 3 none Linux glibc 2.39+ x86-64 Details for halidoscope-22.0.0-py3-none-manylinux_2_39_x86_64.whl
halidoscope-22.0.0-py3-none-manylinux_2_39_aarch64.whl Python 3 none Linux glibc 2.39+ ARM64 Details for halidoscope-22.0.0-py3-none-manylinux_2_39_aarch64.whl
halidoscope-22.0.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for halidoscope-22.0.0-py3-none-macosx_11_0_arm64.whl
halidoscope-22.0.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for halidoscope-22.0.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 178.0 MB

Release files / halidoscope-22.0.0-py3-none-win_amd64.whl

Download URL halidoscope-22.0.0-py3-none-win_amd64.whl
Size 3.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
f24018b29ee225a8e67fd2ff0c53255430481b50dd820f4f883dcef227e50a2a
BLAKE2b-256 checksum
How to use checksums
b2a686e9f7a3483784e9a7f4a9cf2650df43394401ff1bc31f92cdf555a43f71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / halidoscope-22.0.0-py3-none-manylinux_2_39_x86_64.whl

Download URL halidoscope-22.0.0-py3-none-manylinux_2_39_x86_64.whl
Size 84.1 MB
Tags Linux glibc 2.39+ x86-64 Python 3
SHA-256 checksum
How to use checksums
063f2e29e14c098403a5c99c075e8e6ad6f26d8754a98820fe43272e082824f4
BLAKE2b-256 checksum
How to use checksums
552d63f28b8907f45d0e7bd9dcd0d978447920b5731b2f423b4507371287941f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / halidoscope-22.0.0-py3-none-manylinux_2_39_aarch64.whl

Download URL halidoscope-22.0.0-py3-none-manylinux_2_39_aarch64.whl
Size 83.1 MB
Tags Linux glibc 2.39+ ARM64 Python 3
SHA-256 checksum
How to use checksums
9d7ae90ec520c392a0ff658ec79f5deb074da9bf8d5692a83fbfcf377047f994
BLAKE2b-256 checksum
How to use checksums
74dba9365531f9d019c706357a96c163602820f4854b380478522416fe950284
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / halidoscope-22.0.0-py3-none-macosx_11_0_arm64.whl

Download URL halidoscope-22.0.0-py3-none-macosx_11_0_arm64.whl
Size 3.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
edc5249b1825ae5891016bbb684d3b21a78fc3f0165c6d44cfff2c6d26474f1c
BLAKE2b-256 checksum
How to use checksums
62301c14c0b932ebafc260f14b07ac9c709811ee79c32047d9b05e28dde5bfd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / halidoscope-22.0.0-py3-none-macosx_10_12_x86_64.whl

Download URL halidoscope-22.0.0-py3-none-macosx_10_12_x86_64.whl
Size 3.5 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8c1c4ade90e600916f3b52e79f3e8846c250a040111d30e8c7db5cd23857b454
BLAKE2b-256 checksum
How to use checksums
466d9fe6c6f4f80842643e609fca682a6aee1fb0ccf0075f44c2189e6868485c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for halidoscope 22.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for halidoscope-22.0.0-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

22.0.0 This release

5 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page