Repository navigation
test(connectors): deterministic connector oracle in MultiConnectorAnalysisShouldDecreaseCostsAsync - #73
test(connectors): deterministic connector oracle in MultiConnectorAnalysisShouldDecreaseCostsAsync#73jsboige wants to merge 1 commit into
Conversation
…lysisShouldDecreaseCostsAsync Replace the wall-clock Stopwatch.Elapsed ratio assertion with a deterministic assertion on the connector chosen via the production routing: from the analysis's optimizationResults.SuggestedSettings, GetPromptSettings(job).SelectAppropriateTextCompletion(job, completions, SuggestedSettings.ConnectorComparer) returns the named connector selected by the weighted comparer. The wall-clock measure depends on machine load and flaked on Windows CI; the identity of the selected connector is the stable contract. Arithmetic result and cost assertions are kept unchanged. No skip, no extra retry, no widened timing tolerance. See #69. Tested locally under the .NET 6.0 SDK (net6.0, current main target) and the .NET 8.0 SDK (net8.0): 9/9 passed in both cases. Co-Authored-By: Claude-Code <noreply@anthropic.com>
CI status on current
|
jsboige
left a comment
There was a problem hiding this comment.
Preflight adjoint — COMMENTED, head 6333b7dec0e34056ebf58d8246c66a34eec18234.
Lecture complète effectuée : issue #72, body/commentaires/reviews/commits/checks de #73, diff complet, 0 thread inline ; #71 relue au head 3d4d5c547ab6d1af5298426a6fa40c9fb4c63bf8 avec son diff et 0 thread.
Le changement de #73 respecte le scope et l'oracle demandés : un seul fichier de test, suppression du ratio wall-clock, conservation des assertions arithmétiques et de coûts, puis sélection via optimizationResults.SuggestedSettings.GetPromptSettings(...).SelectAppropriateTextCompletion(..., ConnectorComparer). Les trois lignes attendent bien Secondary / Primary / Secondary, et aucun skip, retry ou élargissement de tolérance n'est introduit. La validation ciblée rapportée est 9/9 sous SDK 6 et 9/9 sous SDK 8.
Les rouges actuels ne contredisent pas ce diff : les jambes dotnet-build-and-test échouent à l'étape Build avant les tests sur des erreurs préexistantes (Microsoft.Build.Tasks.Git repository version, Roslynator/CS9057 sous SDK 6, Kernel.Builder/CS0618 sous /warnaserror). Le link-check échoue aussi sur des liens Oobabooga/README préexistants et aucun fichier Markdown n'est modifié ici.
Il reste toutefois un critère d'acceptance non observé : exécution Windows de ce test sous la matrice .NET 8/9. Il y a une dépendance circulaire de validation : #73 hérite encore de la matrice EOL de main, tandis que #71 échoue précisément sur l'ancien oracle absent de son head. Recommandation : produire une branche de validation éphémère combinant les heads #71 + #73, sans retarget ni modification des deux PRs, puis lancer dotnet-ci.yml. Si les 3 jambes Windows et les 3 jambes Docker passent, ai-01 pourra décider l'ordre de merge sur une preuve intégrée plutôt que sur confiance.
Aucun finding de code bloquant nouveau dans #73 ; statut de preflight : code conforme, preuve Windows .NET 8/9 encore à matérialiser.
jsboige
left a comment
There was a problem hiding this comment.
Follow-up preflight adjoint — COMMENTED, PR head 6333b7dec0e34056ebf58d8246c66a34eec18234.
La preuve Windows .NET 8/9 demandée dans la review précédente est désormais matérialisée par le run intégré 33987068397, déclenché sur la branche éphémère validate/pr73+pr71-combined, head 420b5b03428c25a1dafa6afc271ae90e5c24eedf.
Vérification firsthand du run : conclusion success; les six jambes ont passé leurs étapes Build et Run Tests :
- Docker .NET 8 Release — success ;
- Docker .NET 9 Debug — success ;
- Docker .NET 9 Release — success ;
- Windows .NET 8.x Release — success ;
- Windows .NET 9.x Debug — success ;
- Windows .NET 9.x Release — success.
Vérification du contenu combiné contre la base 168fd5d8bef5301a8f849d95492e815a38af8afb : exactement deux commits et deux fichiers. Le premier commit (fb28a350, cherry-pick du patch #71@3d4d5c54) modifie uniquement .github/workflows/dotnet-ci.yml; le second (420b5b03, cherry-pick de #73@6333b7de) modifie uniquement MultiConnectorTextCompletionTests.cs. Aucun troisième changement, aucun retarget et aucune modification des deux PRs.
Le critère restant de #72 est donc satisfait : l'oracle déterministe de #73 passe sur Windows sous .NET 8 et .NET 9 avec la matrice de #71. Aucun finding de code bloquant nouveau.
Séquence recommandée à ai-01 : merger #73 d'abord, mettre ensuite #71 à jour sur main et relancer dotnet-ci.yml sur sa tête exacte, puis merger #71 si les six jambes restent vertes. Cette dernière relance transforme la preuve d'intégration éphémère en preuve attachée à la tête finale de #71, sans élargir le scope de l'une ou l'autre PR.
|
Fermeture avec renvoi : ce correctif est reporte sur la ligne vivante Le portage seul ne suffit pas a rendre le test stable : la course qui le fait echouer est dans le helper |
Summary
Fix the flaky wall-clock oracle in
MultiConnectorAnalysisShouldDecreaseCostsAsync. The test already verified arithmetic results and effective costs, then compared wall-clock durations collected withStopwatcharound async calls. On Windows CI the second pass observed ~27-51 ms for the scenarios expecting a 10x gain and exceeded the bound derived from the first pass; the timing depends on runner load, not the business contract.The analysis already exposes its deterministic outcome through
optimizationResults.SuggestedSettings. For a given job,GetPromptSettings(job).SelectAppropriateTextCompletion(job, completions, SuggestedSettings.ConnectorComparer)returns the connector chosen by the weighted comparer. This PR asserts the identity of that selected connector instead of a wall-clock ratio.Only
dotnet/src/Connectors/Connectors.UnitTests/MultiConnector/TextCompletion/MultiConnectorTextCompletionTests.csis touched. No skip, no extra retry, no widened timing tolerance, no parallel re-implementation of the routing.Changes
expectedConnector(string) instead ofexpectedPerfGain:firstPassDurationAfterWarmup/secondPassDurationAfterWarmupand theAssert.InRangewall-clock ratio assertion.optimizationResults.SuggestedSettingsthrough the production routing and asserts itsName.Validation
dotnet test dotnet/src/Connectors/Connectors.UnitTests/Connectors.UnitTests.csproj -c Release --filter "FullyQualifiedName~MultiConnectorTextCompletion"locally:maintarget,net6.0): 9 passed, 0 failed (946 ms);net8.0): 9 passed, 0 failed (963 ms).Stopwatch.Elapsed, machine-load, or arbitrary-tolerance assertion remains.Notes
See #69— this clears the flaky-test acceptance of the multi-connector routing epic; the global acceptance of ci: la matrice SDK cible 6.0/7.0/8.0-preview (tous EOL) — main rouge depuis 2025-12, 10 PRs dependabot en heritent #69 is not yet fully satisfied, so the issue stays open.