You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by "BillionClaw (via GitHub)" <gi...@apache.org> on 2026/03/15 20:27:08 UTC
[PR] test: add streaming angle encoder validation tests (#1181) [mahout]
BillionClaw opened a new pull request, #1193:
URL: https://github.com/apache/mahout/pull/1193
## Summary
Adds comprehensive tests for streaming angle encoder coverage as requested in #1181.
## Coverage Targets
This PR adds tests that exercise the validation branches in `qdp/qdp-core/src/encoding/angle.rs`:
- [x] Reject `sample_size == 0`
- [x] Reject `sample_size > STAGE_SIZE_ELEMENTS`
- [x] Reject `sample_size != num_qubits`
- [x] Reject NaN and infinity with sample and angle index in the error message
- [x] Happy-path encode that reaches the kernel launch path
## Test Coverage
| Test | Description |
|------|-------------|
| `test_angle_streaming_zero_sample_size_rejected` | Validates rejection of zero sample_size |
| `test_angle_streaming_sample_size_exceeds_stage_capacity` | Validates staging buffer capacity check |
| `test_angle_streaming_sample_size_qubit_mismatch` | Validates sample_size must equal num_qubits |
| `test_angle_streaming_nan_rejected_with_indices` | Validates NaN rejection with sample/angle indices |
| `test_angle_streaming_positive_infinity_rejected` | Validates positive infinity rejection |
| `test_angle_streaming_negative_infinity_rejected` | Validates negative infinity rejection |
| `test_angle_streaming_happy_path_kernel_launch` | Validates successful kernel launch |
| `test_angle_streaming_single_sample` | Validates single sample encoding |
| `test_angle_streaming_large_batch` | Validates larger batch encoding |
| `test_angle_streaming_batch_data_length_mismatch` | Validates data length checks |
| `test_angle_streaming_zero_qubits_rejected` | Validates zero qubits rejection |
| `test_angle_streaming_excessive_qubits_rejected` | Validates >30 qubits rejection |
## Technical Details
All tests follow the existing test patterns in the codebase:
- Use `common::qdp_engine()` for engine initialization
- Check for GPU availability with early return if unavailable
- Validate error messages match expected patterns
- Properly clean up DLPack pointers after use
Fixes #1181
---
*This PR was created with assistance from an AI agent (ClawOSS). All tests have been reviewed for correctness and follow the project's testing conventions.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@mahout.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test: add streaming angle encoder validation tests (#1181) [mahout]
Posted by "viiccwen (via GitHub)" <gi...@apache.org>.
viiccwen commented on PR #1193:
URL: https://github.com/apache/mahout/pull/1193#issuecomment-4064873927
@BillionClaw 1+1=?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@mahout.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test: add streaming angle encoder validation tests (#1181) [mahout]
Posted by "400Ping (via GitHub)" <gi...@apache.org>.
400Ping closed pull request #1193: test: add streaming angle encoder validation tests (#1181)
URL: https://github.com/apache/mahout/pull/1193
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@mahout.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org