You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "shiavm006 (via GitHub)" <gi...@apache.org> on 2025/11/04 05:48:51 UTC

[PR] Fix: Add circuit initialization validation to prevent crashes [mahout]

shiavm006 opened a new pull request, #598:
URL: https://github.com/apache/mahout/pull/598

   ## Problem
   Users could call gate operations before initializing a circuit, causing cryptic `AttributeError: 'NoneType'` crashes deep in backend code.
   
   Example:
   ```python
   qumat = QuMat(config)
   qumat.apply_hadamard_gate(0)  # Crash!
   # AttributeError: 'NoneType' object has no attribute 'h'
   ```
   
   ## Solution
   - Added `_ensure_circuit_initialized()` helper method
   - Validates circuit exists before all gate operations (18 methods covered)
   - Raises clear `RuntimeError` with actionable message:
     
   
   


-- 
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: dev-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: Add circuit initialization validation to prevent crashes [mahout]

Posted by "guan404ming (via GitHub)" <gi...@apache.org>.
guan404ming merged PR #598:
URL: https://github.com/apache/mahout/pull/598


-- 
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: dev-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: Add circuit initialization validation to prevent crashes [mahout]

Posted by "guan404ming (via GitHub)" <gi...@apache.org>.
guan404ming commented on PR #598:
URL: https://github.com/apache/mahout/pull/598#issuecomment-3489659415

   Please help rebase on main, the ci issue is resolved, thanks!


-- 
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: dev-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: Add circuit initialization validation to prevent crashes [mahout]

Posted by "guan404ming (via GitHub)" <gi...@apache.org>.
guan404ming commented on PR #598:
URL: https://github.com/apache/mahout/pull/598#issuecomment-3489688667

   Nice CI passed!


-- 
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: dev-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: Add circuit initialization validation to prevent crashes [mahout]

Posted by "rawkintrevo (via GitHub)" <gi...@apache.org>.
rawkintrevo commented on PR #598:
URL: https://github.com/apache/mahout/pull/598#issuecomment-3487274727

   Thanks for the add @shiavm006 - in the future please just create an issue first, so we can discuss it. This seems fairly trivial and is a good idea, so I'll merge after you resolve conflicts. Just a note for next time. 


-- 
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: dev-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: Add circuit initialization validation to prevent crashes [mahout]

Posted by "shiavm006 (via GitHub)" <gi...@apache.org>.
shiavm006 commented on PR #598:
URL: https://github.com/apache/mahout/pull/598#issuecomment-3489203686

   > Thanks for the add @shiavm006 - in the future please just create an issue first, so we can discuss it. This seems fairly trivial and is a good idea, so I'll merge after you resolve conflicts. Just a note for next time.
   
   Ahh got it 
   will make sure of thsi thing from the next time i will surely make the issue and discuss it first 


-- 
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: dev-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org