viiccwen opened a new issue, #804:
URL: https://github.com/apache/mahout/issues/804
### Description
The preprocessing pipeline in `qdp-core` did not validate input data for NaN
(Not a Number) and Infinity values, allowing invalid numerical values to
propagate through the quantum encoding pipeline.
### Steps to Reproduce
Writing a script to reproduce it:
```rust
use qdp_core::preprocessing::Preprocessor;
// This would pass validation and return NaN
let data_with_nan = vec![1.0, f64::NAN, 3.0];
let result = Preprocessor::calculate_l2_norm(&data_with_nan);
// Result: Ok(NaN)
```
### Expected Behavior
All preprocessing functions should return `Err(MahoutError::InvalidInput)`
with clear error messages when NaN or Infinity values are detected.
### Actual Behavior
When input data contains NaN or Infinity values:
- `validate_input()` and `validate_batch()` would pass validation
- `calculate_l2_norm()` and `calculate_batch_l2_norms()` would return
NaN/Infinity
- These invalid values would propagate to quantum simulation, causing:
- Invalid quantum state vectors
- GPU computation errors
- Silent failures or crashes
### Environment
- In every environment
### Additional Context
I'm willing to help to solve the issue! 🙌
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]