Skip to content

refactor(tuic): use tuic-core re-exported quinn#1429

Merged
ibigbug merged 4 commits into
masterfrom
build/tuic-v2
May 18, 2026
Merged

refactor(tuic): use tuic-core re-exported quinn#1429
ibigbug merged 4 commits into
masterfrom
build/tuic-v2

Conversation

@Itsusinn
Copy link
Copy Markdown
Member

@Itsusinn Itsusinn commented May 18, 2026

Switch tuic-core dep from tag v1.8.1 to build/tuic branch which re-exports quinn internally.

Changes:

  • Remove tuic-quinn direct quinn dependency
  • Replace all tuic_quinn:: imports with tuic_core::quinn::
  • Fix nested tuic_core::quinn::quinn:: paths → tuic_core::quinn::

Assisted-by: OpenClaw:deepseek-v4-flash

Summary by CodeRabbit

  • Chores
    • TUIC core dependency now tracks an active development branch for ongoing improvements.
    • Removed an older TUIC-related dependency and simplified TUIC feature flags.
    • Internal QUIC library integration/imports were consolidated for cleaner maintenance.
    • No user-facing behavior or public APIs were changed.

Review Change Stack

- Switch tuic-core dep from tag v1.8.1 to build/tuic branch
- Remove tuic-quinn (direct quinn dep) in favor of tuic-core re-exports
- Replace tuic_quinn:: with tuic_core::quinn::
- Fix tuic_core::quinn::quinn:: nested path → tuic_core::quinn::

Assisted-by: OpenClaw:deepseek-v4-flash
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e7cf31c0-21be-41c3-b045-116dcb664ef6

📥 Commits

Reviewing files that changed from the base of the PR and between 4af3e98 and 1b3df18.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • clash-lib/Cargo.toml
  • clash-lib/src/proxy/converters/tuic.rs
  • clash-lib/src/proxy/tuic/handle_stream.rs
  • clash-lib/src/proxy/tuic/mod.rs
  • clash-lib/src/proxy/tuic/types.rs

📝 Walkthrough

Walkthrough

Consolidates TUIC dependencies by removing tuic-quinn, updating tuic-core to track branch build/tuic, pruning conditional rustls sub-features from aws-lc-rs/ring, and changing TUIC-related imports to tuic_core::quinn across proxy source files.

Changes

TUIC Dependency Consolidation

Layer / File(s) Summary
Cargo dependency and feature updates
clash-lib/Cargo.toml
Removes tuic-quinn dependency and its conditional rustls sub-features from aws-lc-rs and ring, updates tuic feature to ["dep:tuic-core","dep:register-count"], and switches tuic-core from tag v1.8.1 to git branch build/tuic.
Import path updates across TUIC modules
clash-lib/src/proxy/converters/tuic.rs, clash-lib/src/proxy/tuic/mod.rs, clash-lib/src/proxy/tuic/handle_stream.rs, clash-lib/src/proxy/tuic/handle_task.rs, clash-lib/src/proxy/tuic/types.rs
Replaces imports that referenced tuic_quinn or nested quinn:: paths with direct imports from tuic_core::quinn (examples: VarInt, RecvStream, SendStream, QuinnConnection, QuinnEndpoint, ZeroRttAccepted).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Watfaq/clash-rs#1397: Also adjusts clash-lib/Cargo.toml feature wiring for aws-lc-rs and ring related to rustls backend feature forwarding.

Poem

🐰 One crate hops out, the core stays near,

Quinn's paths grow shorter, imports clear,
Cargo trims branches, features align,
TUIC now sings from a single vine,
🎉 Rusty carrots and tidy lines.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: refactoring TUIC imports to use quinn re-exported from tuic-core instead of direct tuic-quinn imports.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@clash-lib/Cargo.toml`:
- Line 187: Replace the branch pin for the tuic-core dependency in Cargo.toml
with an explicit rev to make the commit visible in the manifest: update the
dependency entry for "tuic-core" (currently using branch = "build/tuic") to use
rev = "562ea5706d28529e8db74128bb4a23edfe9c0ffa" instead of branch, keeping the
same git URL, optional = true and features list so the exact commit is
documented in Cargo.toml.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e2d40050-b6c9-4eb9-89dd-9cf0ea931f51

📥 Commits

Reviewing files that changed from the base of the PR and between 8c2445e and 4af3e98.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • clash-lib/Cargo.toml
  • clash-lib/src/proxy/converters/tuic.rs
  • clash-lib/src/proxy/tuic/handle_stream.rs
  • clash-lib/src/proxy/tuic/handle_task.rs
  • clash-lib/src/proxy/tuic/mod.rs
  • clash-lib/src/proxy/tuic/types.rs

Comment thread clash-lib/Cargo.toml

# tuic
tuic-core= { tag = "v1.8.1", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
tuic-core= { branch = "build/tuic", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Remote build/tuic head:"
git ls-remote https://github.com/Itsusinn/tuic.git refs/heads/build/tuic

echo
echo "Pinned tuic-core entry in Cargo.lock (if present):"
if [ -f Cargo.lock ]; then
  rg -n -C3 'name = "tuic-core"|git\+https://github.com/Itsusinn/tuic\.git' Cargo.lock
else
  echo "Cargo.lock not found in this checkout."
fi

Repository: Watfaq/clash-rs

Length of output: 453


🏁 Script executed:

#!/bin/bash
# Check if Cargo.lock exists in repo and is tracked
if git ls-files Cargo.lock | grep -q Cargo.lock; then
  echo "Cargo.lock is tracked in git"
  git log --oneline -1 -- Cargo.lock 2>/dev/null | head -1 || echo "Cargo.lock exists"
else
  echo "Cargo.lock is NOT tracked in git"
fi

# Confirm the dependency source in Cargo.toml matches what we saw
rg -n 'tuic-core' clash-lib/Cargo.toml | head -5

Repository: Watfaq/clash-rs

Length of output: 348


Consider pinning tuic-core to an explicit rev for clarity.

The current branch = "build/tuic" reference is already locked via Cargo.lock to commit 562ea5706d28529e8db74128bb4a23edfe9c0ffa, ensuring deterministic builds. Switching to an explicit rev would make the pinned commit visible in Cargo.toml itself, improving code readability and reproducibility clarity.

Suggested change
-tuic-core= { branch = "build/tuic", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
+tuic-core = { rev = "562ea5706d28529e8db74128bb4a23edfe9c0ffa", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tuic-core= { branch = "build/tuic", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
tuic-core = { rev = "562ea5706d28529e8db74128bb4a23edfe9c0ffa", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@clash-lib/Cargo.toml` at line 187, Replace the branch pin for the tuic-core
dependency in Cargo.toml with an explicit rev to make the commit visible in the
manifest: update the dependency entry for "tuic-core" (currently using branch =
"build/tuic") to use rev = "562ea5706d28529e8db74128bb4a23edfe9c0ffa" instead of
branch, keeping the same git URL, optional = true and features list so the exact
commit is documented in Cargo.toml.

Assisted-by: OpenClaw:deepseek-v4-flash
@ibigbug
Copy link
Copy Markdown
Member

ibigbug commented May 18, 2026

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits May 18, 2026 15:38
Co-authored-by: ibigbug <543405+ibigbug@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Watfaq/clash-rs/sessions/9d1912b7-4322-4f5c-ac39-9d2e4908d2af

Co-authored-by: ibigbug <543405+ibigbug@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

@copilot resolve the merge conflicts in this pull request

Conflicts are resolved and the branch is updated with master in commit 1b3df18.

Copilot AI requested a review from ibigbug May 18, 2026 15:42
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown
Contributor

📊 Proxy Throughput Results

Shadowsocks

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
plain 32 MB 3 12799.3 ±277.5 11353.2 ±2470.3
obfs-http 32 MB 3 13890.2 ±7431.6 12957.8 ±2699.0
obfs-tls 32 MB 3 15547.0 ±1453.1 14880.4 ±774.8
shadow-tls-v3 32 MB 3 13942.9 ±2203.8 12039.8 ±1206.8
v2ray-plugin-ws-tls 32 MB 3 11984.8 ±1762.0 12408.3 ±1607.9

Trojan

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
tcp 32 MB 3 14126.3 ±3140.3 12963.6 ±1525.1
ws 32 MB 3 13877.9 ±2398.1 13745.5 ±1640.6
grpc 32 MB 3 15135.7 ±6665.3 12853.9 ±1418.7

VMess

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
tcp 32 MB 3 15485.2 ±2531.8 15601.8 ±1344.0
tcp-tls 32 MB 3 15747.2 ±1280.4 12847.4 ±3969.3
ws 32 MB 3 10505.0 ±8656.7 16130.0 ±908.5
h2 32 MB 3 14725.7 ±1649.5 14515.8 ±2229.7
grpc 32 MB 3 13982.7 ±7841.9 12537.2 ±2722.0

VLESS

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
tcp 32 MB 3 13402.6 ±1558.7 13954.6 ±1470.1
ws 32 MB 3 11922.8 ±6861.2 11119.1 ±327.0
h2 32 MB 3 13317.1 ±1421.8 13642.5 ±1617.0
grpc 32 MB 3 17500.1 ±3141.8 16142.1 ±4103.1

SOCKS5

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
auth 32 MB 3 13147.3 ±1942.0 12763.2 ±1561.1
noauth 32 MB 3 11867.8 ±379.7 11923.0 ±6621.7

AnyTLS

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
tls 32 MB 3 10006.9 ±2212.7 13018.8 ±2531.8

Hysteria2

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
plain 32 MB 3 13553.2 ±131.7 13343.7 ±952.8
salamander 32 MB 3 13062.4 ±860.8 13340.2 ±280.3

TUIC

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
bbr 32 MB 3 15713.3 ±278.4 13472.2 ±1297.6
cubic 32 MB 3 17429.1 ±1062.4 15960.8 ±256.8
new_reno 32 MB 3 12977.8 ±2824.0 14786.7 ±945.7

ShadowQUIC

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
plain 32 MB 3 10937.6 ±2549.8 13428.9 ±1241.0
over-stream 32 MB 3 14643.7 ±3064.9 15579.6 ±1626.5

SSH

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
password 32 MB 3 13153.4 ±631.8 13580.9 ±473.6
ed25519 32 MB 3 12074.2 ±3171.4 9248.8 ±1090.3

Netem Tests (50 ms delay, 1% packet loss)

Shadowsocks

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
plain-netem 32 MB 3 11668.1 ±2444.5 12172.8 ±1841.6

Trojan

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
tcp-netem 32 MB 3 12445.6 ±2048.7 13004.7 ±1261.8

Hysteria2

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
plain-netem 32 MB 3 9193.9 ±6014.6 12495.8 ±1285.7

TUIC

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
bbr-netem 32 MB 3 13826.1 ±3257.4 14262.2 ±2386.0

ShadowQUIC

Transport Payload Runs Upload Mbps (±σ) Download Mbps (±σ)
plain-netem 32 MB 3 16149.7 ±677.8 13435.1 ±332.2

Ran 34 variant(s) in parallel; each direction transfers the full payload.

🖥️ Test Environment

OS Linux 6.17.0-1013-azure
Architecture x86_64
Kernel 6.17.0-1013-azure
CPU AMD EPYC 9V74 80-Core Processor
CPU Cores 4
Memory 15.61 GB
Docker 28.0.4
Rust rustc 1.95.0 (59807616e 2026-04-14)

📎 View full workflow run and download artifacts

Full test log

Download the throughput-results artifact from the workflow run for the full log.

@ibigbug ibigbug merged commit 6e6b2b8 into master May 18, 2026
36 checks passed
@ibigbug ibigbug deleted the build/tuic-v2 branch May 18, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants