Skip to content

test: enforce native relative coverage#52

Merged
hyfdev merged 4 commits into
mainfrom
agent/semantic-test-matrix
Jul 14, 2026
Merged

test: enforce native relative coverage#52
hyfdev merged 4 commits into
mainfrom
agent/semantic-test-matrix

Conversation

@hyfdev

@hyfdev hyfdev commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • add fixed Unix and Windows expected-output matrices for relative_with, including borrowed and owned cwd arguments, mixed absolute/relative inputs, dirty spelling, root clamping, trailing separators, root-relative paths, drive-relative paths, and different-drive fallback
  • pin relative, try_relative, and relative_with value and Cow contracts, including receiver-only borrowing when base and cwd are owned temporaries
  • run the bounded 224,676-pair short-path oracle through the selected production relative_str dispatch as well as the specialized helper
  • make native CI verify the expected Rust host, require NEON on macOS ARM64, and require one platform-specific test sentinel so a cfg change cannot silently become a zero-test success
  • run the default-feature suite for the sugar_path package alone so the allocation tracker's cached_current_dir dependency cannot enable that feature through workspace feature unification
  • make the default and all-feature commands declare the expected cached_current_dir state, with an executable sentinel that fails if Cargo feature unification makes the two configurations identical
  • document the finite semantic coverage model, the current status of the independent follow-up PRs, and the Windows-GNU opt-in status

Why

The existing cwd-dependent tests sometimes used relative_with as the expected result for ambient relative, so a shared mistake could remain self-consistent. The exhaustive macOS/Linux test called the specialized private helper directly, which did not prove that production dispatch still selected the intended implementation. In addition, the *-latest CI labels did not fail if a runner architecture changed and compiled every relevant test away.

An adversarial review of the follow-up cache matrix found that cargo test --workspace was not a true default-feature run: the allocation tracker enables cached_current_dir, and Cargo unified that feature into the main crate. Selecting -p sugar_path makes the default and all-feature jobs exercise distinct configurations. Because the cache tests adapt their expected result through cfg!(feature = "cached_current_dir"), they would not detect a future regression back to the workspace command; the new feature sentinel makes the intended off/on pair executable.

Impact

This changes no production algorithm, public API, benchmark, or allocation snapshot. The only src changes are inside a #[cfg(test)] module. The PR makes missing native coverage fail explicitly and keeps the independently reviewed slash-policy, Windows encoded-root, absolutization, cache, and owned-normalization follow-ups current in the testing-strategy record.

Validation

  • cargo +1.97.0 fmt --all --check
  • cargo +1.97.0 clippy --locked --workspace --all-targets --all-features -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo +1.97.0 doc --locked --workspace --all-features --no-deps
  • SUGAR_PATH_EXPECT_CACHED_CURRENT_DIR=0 cargo +1.97.0 test --locked -p sugar_path
  • SUGAR_PATH_EXPECT_CACHED_CURRENT_DIR=1 cargo +1.97.0 test --locked --workspace --all-features
  • changed Windows-gated integration tests metadata-checked for x86_64-pc-windows-msvc
  • host, NEON, platform-registration, and default/all-feature sentinels checked with both passing inputs and deliberately wrong inputs
  • final adversarial review: PASS

The branch is rebased onto merged PRs #56 and #57. The cached-cwd and owned-normalization entries now point to those merged checkpoints, while PRs #53#55 remain independent Drafts.

Hosted CI at bc69528 passes all eight repository jobs. The logs confirm that the Linux, native Windows MSVC, and macOS ARM64 jobs execute the distinct default/all-feature configurations and their platform sentinels. The macOS job verifies the aarch64-apple-darwin host and NEON availability. The external CodSpeed analysis reports only as_path/rolldown_corpus/string at 226.7→255.8 ns while warning that runtime environments differ; this branch changes no production, dependency, benchmark, or benchmark input, and the same pair has previously appeared in the opposite direction.

@codspeed-hq

codspeed-hq Bot commented Jul 14, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 11.4%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 227 untouched benchmarks
⏩ 38 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation string 226.7 ns 255.8 ns -11.4%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing agent/semantic-test-matrix (bc69528) with main (8a3aeac)

Open in CodSpeed

Footnotes

  1. 38 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@hyfdev hyfdev marked this pull request as ready for review July 14, 2026 12:38
Copilot AI review requested due to automatic review settings July 14, 2026 12:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@hyfdev hyfdev force-pushed the agent/semantic-test-matrix branch from 9accf28 to 1f5f7a1 Compare July 14, 2026 13:30
@hyfdev hyfdev merged commit 36ea1df into main Jul 14, 2026
8 of 9 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 14, 2026
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.

2 participants