You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "rmuir (via GitHub)" <gi...@apache.org> on 2025/02/06 16:46:34 UTC

[I] flaky test: concatenate turns NFA into a DFA and it causes test fail [lucene]

rmuir opened a new issue, #14210:
URL: https://github.com/apache/lucene/issues/14210

   ### Description
   
   ```
   gradlew test --tests TestAutomaton.testRandomFinite -Dtests.seed=651DFCF4FA5E1305 -Dtests.locale=xog-Latn-UG -Dtests.timezone=America/Santarem -Dtests.asserts=true -Dtests.file.encoding=UTF-8
   ```
   
   The test has this code:
   ```
   boolean wasDeterministic1 = a.isDeterministic();
   a = Operations.concatenate(Automata.makeString(prefix.utf8ToString()), a);
   assertEquals(wasDeterministic1, a.isDeterministic());
   ```
   
   This test now fails sometimes, because original A is NFA and then after concatenation, it is deterministic.
   It may be a bonus, as a result of adding `removeDeadStates()` to concatenate, or it may be a bug.
   
   ### Version and environment details
   
   _No response_


-- 
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: issues-unsubscribe@lucene.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] flaky test: concatenate turns NFA into a DFA and it causes test fail [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on issue #14210:
URL: https://github.com/apache/lucene/issues/14210#issuecomment-2640522300

   I pushed fix to correct the build. but I will add more tracing to this seed, to see who is adding the "nondetermistic dead states". 
   
   if it is an automaton method, we need to fix it to remove these dead states: it turns user's DFA into an NFA.


-- 
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: issues-unsubscribe@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] flaky test: concatenate turns NFA into a DFA and it causes test fail [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on issue #14210:
URL: https://github.com/apache/lucene/issues/14210#issuecomment-2640461459

   And of course the automaton is massive, nightmare:
   
   ![Image](https://github.com/user-attachments/assets/d61e0f36-b4bf-4cd2-ac4a-4556922b7142)


-- 
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: issues-unsubscribe@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] flaky test: concatenate turns NFA into a DFA and it causes test fail [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on issue #14210:
URL: https://github.com/apache/lucene/issues/14210#issuecomment-2640528582

   Suspect identified:
   ```java
               // NOTE: This can add a dead state:
               a = Operations.optional(a);
               terms.add(newBytesRef());
   ```


-- 
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: issues-unsubscribe@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] flaky test: concatenate turns NFA into a DFA and it causes test fail [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on issue #14210:
URL: https://github.com/apache/lucene/issues/14210#issuecomment-2640481736

   If i comment out `removeDeadStates()` then the test passes.
   If I add the `removeDeadStates()` to the test before doing any concatenate, the test passes.
   
   The problem happens because you can have automaton, with some nondeterminism, but all in dead states. So when you remove the dead nondetermisticy states, the automaton is now deterministic.


-- 
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: issues-unsubscribe@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] flaky test: concatenate turns NFA into a DFA and it causes test fail [lucene]

Posted by "asfgit (via GitHub)" <gi...@apache.org>.
asfgit closed issue #14210: flaky test: concatenate turns NFA into a DFA and it causes test fail
URL: https://github.com/apache/lucene/issues/14210


-- 
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: issues-unsubscribe@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] flaky test: concatenate turns NFA into a DFA and it causes test fail [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on issue #14210:
URL: https://github.com/apache/lucene/issues/14210#issuecomment-2640539953

   The problem is Operations.reverse(). I will open an 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: issues-unsubscribe@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org