Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
74f9d98
build(tooling): allow cli scope in commitlint
HalfSweet Nov 29, 2026
4b5f387
feat(capture): add channel profiling, transitions and timing queries
HalfSweet Nov 29, 2026
2b95203
feat(decode): add stream summaries and structured filters in hsync-ui…
HalfSweet Nov 29, 2026
b4c1eb8
feat(session): expose decoder wait, summary and filter queries
HalfSweet Nov 29, 2026
9a3e5bf
feat(cli): add standalone agent-friendly hsync-cli binary
HalfSweet Nov 29, 2026
31a6cc7
test(cli): add end-to-end integration tests for hsync-cli
HalfSweet Nov 29, 2026
873b9aa
docs: document hsync-cli and add official agent skill
HalfSweet Nov 29, 2026
a0302ab
fix(uiharu): satisfy Rust 1.100 clippy needless_range_loop
HalfSweet Nov 30, 2026
f40d52f
fix(capture): satisfy Rust 1.100 clippy needless_range_loop
HalfSweet Nov 30, 2026
74c748e
fix(decode): avoid DecodeSet::wait deadlock and harden event filters
HalfSweet Nov 30, 2026
a038948
fix(cli): harden flag parsing, exec timeouts, units and command edges
HalfSweet Nov 30, 2026
d05f1e2
test(cli): add regression tests for exec timeout, flags and queries
HalfSweet Nov 30, 2026
4eb1917
docs: exempt hsync-cli from the i18n-keys-only rule in AGENTS.md
HalfSweet Dec 1, 2026
2ae6452
refactor(cli): define CliError as a thiserror enum
HalfSweet Dec 1, 2026
8fdfe1e
fix(cli): honour fired buffer triggers and bound waits after stop
HalfSweet Dec 1, 2026
3e333a2
fix(cli): stop --exec from hanging on background processes
HalfSweet Dec 1, 2026
fb2cd9f
fix(cli): give --exec a grace period before killing it
HalfSweet Dec 1, 2026
c8cd009
fix(cli): pass --exec commands to cmd.exe verbatim on Windows
HalfSweet Dec 1, 2026
c534a24
fix(cli): apply raw device options before sizing --duration
HalfSweet Dec 1, 2026
bcb4d7a
fix(cli): scale the default --timeout with the requested capture
HalfSweet Dec 1, 2026
2381e97
perf(decode): visit filtered decode events in one pass
HalfSweet Dec 1, 2026
9a4990e
perf(cli): stream decode ndjson output in one pass per stream
HalfSweet Dec 1, 2026
406c38d
fix(cli): keep the view session when decode saves an .hsync file
HalfSweet Dec 1, 2026
7d932fd
fix(cli): mark pulses cut off by the capture boundary
HalfSweet Dec 1, 2026
f06b961
fix(cli): fit wave columns to windows narrower than --width
HalfSweet Dec 1, 2026
b45cc61
fix(cli): reject search patterns on channels the capture lacks
HalfSweet Dec 1, 2026
f927fd1
fix(cli): exit quietly when stdout is closed early
HalfSweet Dec 1, 2026
fb6c7c0
test(decode): cover one-pass for_each_match over a decode store
HalfSweet Dec 1, 2026
09eaf6a
test(cli): cover capture deadlines, default timeout and exec grace
HalfSweet Dec 1, 2026
94bd4a6
test(cli): add regression tests for options, decode save and queries
HalfSweet Dec 1, 2026
35130aa
docs: document --exec-grace, timeout defaults and truncated pulses
HalfSweet Dec 1, 2026
8ece7a1
docs(cli): name println! in the output module's doc comments
HalfSweet Dec 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions AGENTS.md

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ Sipeed has given strong support to HSync's work on its SLogic analyzers.
- **Keyboard shortcuts** for zooming, panning, searching, opening, saving and more, all of which you can change.
- **Updates inside the app**: HSync checks at startup and installs a new version in one click.

### Command line & automation (`hsync-cli`)

- **Standalone headless CLI (`hsync-cli`)** for scripts, hardware-in-the-loop tests and AI coding agents: `doctor`, `devices`, `catalog`, declarative `capture` (with `--trigger-timeout`, `--fallback-instant`, memory guardrails and `--exec` arm-then-act DUT stimulation), L0 signal `inspect`, L1/L2 `decode` (shorthand pipelines, summaries, structured `--where` filters, compact protocol transcripts and NDJSON), L3 `transitions`, Unicode `wave`, `measure` (pulses, edges, glitches, cross-channel deltas), `search` and `export`.
- **Structured `--json` mode** across every command (including dual sample/time coordinates and actionable error hints) plus a ready-to-use Agent Skill in [skills/hsync-cli/SKILL.md](skills/hsync-cli/SKILL.md). See the [CLI guide](docs/cli.md).

## Download

Get the latest version from the [Releases page](https://github.com/HalfSweet/HSync/releases/latest).
Expand Down
5 changes: 5 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ SLogic 系列逻辑分析仪的适配得到了矽速科技(Sipeed)的大力
- **快捷键**覆盖缩放、平移、搜索、打开、保存等操作,均可自定义。
- **应用内更新**:启动时检查新版本,一键安装。

### 命令行与自动化(`hsync-cli`)

- **独立无头命令行工具(`hsync-cli`)**,面向脚本、硬件在环测试与 AI Agent:涵盖 `doctor`、`devices`、`catalog`、声明式 `capture`(支持 `--trigger-timeout`、`--fallback-instant`、内存护栏与 `--exec` 先武装后激励协同)、L0 信号体检 `inspect`、L1/L2 `decode`(简写流水线、解码摘要、结构化 `--where` 过滤、紧凑协议视图与 NDJSON)、L3 `transitions` / Unicode `wave` / `measure`(脉宽、边沿、毛刺、跨通道延迟)、`search` 与 `export`。
- **全局 `--json` 结构化输出**(统一双坐标系与可恢复错误提示),并在 [skills/hsync-cli/SKILL.md](skills/hsync-cli/SKILL.md) 提供官方 Agent Skill。参见[命令行指南(英文)](docs/cli.md)。

## 下载

在 [Releases 页面](https://github.com/HalfSweet/HSync/releases/latest)下载最新版本。
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default {
'decode',
'fileio',
'session',
'cli',
'app',
// The uiharu decode engine (uiharu/)
'uiharu',
Expand Down
19 changes: 13 additions & 6 deletions crates/hsync-capture/src/analog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,13 @@ impl AnalogData {
let from = self.head + from as usize;
let to = self.head + to as usize;
let mut result = None;
for chunk in from / CHUNK..=(to - 1) / CHUNK {
let first_chunk = from / CHUNK;
let last_chunk = (to - 1) / CHUNK;
for (offset, chunk_data) in self.chunks.range(first_chunk..=last_chunk).enumerate() {
let chunk = first_chunk + offset;
let base = chunk * CHUNK;
let range = from.max(base) - base..to.min(base + CHUNK) - base;
if let Some(part) = self.chunks[chunk].extent(range) {
if let Some(part) = chunk_data.extent(range) {
result = Some(join(result, part));
}
}
Expand All @@ -191,11 +194,15 @@ impl AnalogData {
end: SampleIndex,
bins: usize,
) -> Vec<Option<(f32, f32)>> {
let n = end.saturating_sub(start);
(0..bins as u64)
if bins == 0 || end <= start {
return vec![None; bins];
}
let n = u128::from(end - start);
let bins_u128 = bins as u128;
(0..bins_u128)
.map(|column| {
let from = start + n * column / bins as u64;
let to = start + n * (column + 1) / bins as u64;
let from = start + (n * column / bins_u128) as u64;
let to = start + (n * (column + 1) / bins_u128) as u64;
self.volt_extent(from, to.max(from + 1))
})
.collect()
Expand Down
6 changes: 6 additions & 0 deletions crates/hsync-capture/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mod capture;
mod channel;
mod ingest;
mod pattern;
mod profile;
mod summary;
mod words;

Expand All @@ -17,4 +18,9 @@ pub use capture::{CaptureInfo, LogicCapture};
pub use channel::{ChannelData, EdgeCount, Pulse, cell};
pub use ingest::CrossDeinterleaver;
pub use pattern::{PatternCondition, PatternLevel};
pub use profile::{
AnalogProfile, BurstInterval, ChannelActivity, ChannelProfile, DEFAULT_MAX_BURSTS,
DEFAULT_PROFILE_EDGE_LIMIT, EdgeDeltaHit, EdgeDeltaSummary, EdgeKind, GlitchHit,
ProfileOptions, PulseDistribution, TransitionRow,
};
pub use words::{CHUNK_SAMPLES, CHUNK_WORDS, ChunkView};
Loading