Halidoscope
An interactive GUI and CLI for working with Halide traces.
Prerequisites
You'll need a few prerequisites to get everything working.
- Tauri's
system dependencies
for your OS.
- Note that you only need dependencies for desktop targets.
- A Rust installation.
- A Node.js installation.
- 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:
- A
sizesstd::vector<int32_t>defining the dimensionality of output buffers for Halidoscope (and, under the hood, the Halide runtime) to allocate. - An
outputRealizationArgrepresenting an already-allocated destination (e.g., aBuffer) 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.hltracefile 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.hltracefile 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.hltracefile 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.hltracefile to snapshot.-f, --func <name>(required): Name of the Func to snapshot.-i, --packet-index <n>: Global packet index to snapshot. Defaults to0.-m, --mode <mode>: Rendering mode. One ofgrayscale(default),rgbstore-frequency,load-frequency,redundant-stores, orreuse-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.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| halidoscope-22.1.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for halidoscope-22.1.0-py3-none-win_amd64.whl |
| halidoscope-22.1.0-py3-none-manylinux_2_39_x86_64.whl | Python 3 | none | Linux glibc 2.39+ x86-64 | Details for halidoscope-22.1.0-py3-none-manylinux_2_39_x86_64.whl |
| halidoscope-22.1.0-py3-none-manylinux_2_39_aarch64.whl | Python 3 | none | Linux glibc 2.39+ ARM64 | Details for halidoscope-22.1.0-py3-none-manylinux_2_39_aarch64.whl |
| halidoscope-22.1.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for halidoscope-22.1.0-py3-none-macosx_11_0_arm64.whl |
| halidoscope-22.1.0-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details for halidoscope-22.1.0-py3-none-macosx_10_12_x86_64.whl |
Total release size: 178.0 MB
Release files / halidoscope-22.1.0-py3-none-win_amd64.whl
| Download URL | halidoscope-22.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f5abe76d39e4f99975d9aba915d46827c55ef327fcd328b8167659344aadb74d
|
|
BLAKE2b-256 checksum How to use checksums |
159040768b1141844744db5f109e808c4583f0e5da4931e1ba543646a6f7daed
|
| 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 31, 2026.
Transparency logRelease files / halidoscope-22.1.0-py3-none-manylinux_2_39_x86_64.whl
| Download URL | halidoscope-22.1.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 |
9b8bc53ef183bc945b1fcd967a2bba22c9f187425f90225cf8b353c5f18a5209
|
|
BLAKE2b-256 checksum How to use checksums |
a758611171aa62c4bd9e54c09567921077c2488d31bf185f2e6c28f6751b4c30
|
| 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 31, 2026.
Transparency logRelease files / halidoscope-22.1.0-py3-none-manylinux_2_39_aarch64.whl
| Download URL | halidoscope-22.1.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 |
409bb62745ae12c67405762d9eed1e395fd64441dfbba8016d27faa1f8cd1af3
|
|
BLAKE2b-256 checksum How to use checksums |
2c1d6fc3a348eb4575a456ae9bc2167ad0299962abbd2120cb71fbe44375ac2b
|
| 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 31, 2026.
Transparency logRelease files / halidoscope-22.1.0-py3-none-macosx_11_0_arm64.whl
| Download URL | halidoscope-22.1.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 |
6e94981795aeabd160dc62988a9d44c2dd2ea672515824154ef0c66d6e1e12f4
|
|
BLAKE2b-256 checksum How to use checksums |
aae98536f8219b71c4cd181e30640ba24f4bb50f10cc52d4f087aac4d1dbc68e
|
| 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 31, 2026.
Transparency logRelease files / halidoscope-22.1.0-py3-none-macosx_10_12_x86_64.whl
| Download URL | halidoscope-22.1.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 |
a90ba2c07358f6dd5f79be9de372e8594282a3794eed464497a57eb3f9b43739
|
|
BLAKE2b-256 checksum How to use checksums |
6c5783c77ae407e92eac1b4b04c1906ab02db59efe903bfa1c8207aa4b674d35
|
| 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 31, 2026.
Transparency logSecurity for halidoscope 22.1.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.
Attestation for halidoscope-22.1.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 31, 2026.
Transparency logA 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.