Planner: splitParts regex is quadratic on a quote followed by many backticks, so the fuzz test fails at random
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 86/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- performance, testing
Línea de trabajo
Empieza con splitParts() en src/planner/pipeline-steps.ts y la propiedad que falla en tests/fuzz/repository-text.fuzz.test.ts. Ejecuta el comando de reproducción del issue con la semilla proporcionada y luego compara los resultados de la expresión regular actual con una comprobación lineal para la forma del contraejemplo. El trabajo estará terminado cuando la comprobación se ejecute en tiempo lineal, conserve las respuestas de la expresión regular y la prueba fuzz pase con distintas semillas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
tests/fuzz/repository-text.fuzz.test.ts ("workflow files and package scripts") fails on main from time to time, depending on the random seed. It failed in CI on #291, a docs-only PR (run 44197635763, check (ubuntu-26.04, 22)):
not ok 2 - workflow files and package scripts
Property failed after 4 tests
{ seed: -1959240610, path: "3:6:4:7:7", endOnFailure: true }
Counterexample: ["\"\"`````````…"]
[cause]: Error: took 3238 ms
Reproduce (main @ 40aa308):
FC_SEED=-1959240610 npx tsx --test --test-name-pattern="workflow files and package scripts" tests/fuzz/repository-text.fuzz.test.ts
Cause. A CPU profile puts almost all the time in one regex in splitParts(), in src/planner/pipeline-steps.ts (L103):
if (parts.some((part) => !part || /"[^"]*[$`][^"]*"/.test(part)) || …
On a part that holds a " followed by a long run of backticks with no closing quote, [^"]* backtracks over the whole run from every starting point, so time grows quadratically. discoverGateChecks() reaches this through any gate script, for example "check": "tsc && \"\"" + "".repeat(n)`:
| backticks | discoverGateChecks({ check: "tsc && " + text }) |
|---|---|
| 25,000 | 0.9 s |
| 50,000 | 3.5 s |
| 100,000 | 12.9 s |
Without the leading "" it takes 1 to 3 ms. The text comes from the analysed repository's package.json, so a repository can stall planning. The fuzz test was written to catch exactly this, which is why it fails whenever the generator draws that shape.
Expected: the check is linear and gives the same answers as the regex, and the fuzz test passes for every seed.
- Lenguaje dominante
- TypeScript
- Estrellas
- 0
- Forks
- 4
- Merge medio
- 18 h 41 min
- PR fusionados (30 d)
- 48
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DiffCI/core
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Agent tools: changed_files lists only the new path of a renamed filePosiblemente ocupada @FredApps la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
DiffCI/core#243 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
adapter good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
adapter bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
Todos los issues de DiffCI/core
Issues similares
-
agent-ready area: ui-server priority: p3 type: test
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
schlessera/brain-kit#4249 ·
Los mantenedores suelen responder en 1 día
-
documentation tool triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
can1357/oh-my-pi#19608 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
dependencies tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
bcgov/nr-waste-plus#1549 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
blixvip/solana-token-meta#17 ·
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
blixvip/solana-tx-parse#18 ·