Skip to content

[RegexDiff X64] [stephentoub] Reduce backtracking for greedy loops followed ... #1821

@MihuBot

Description

@MihuBot

Job completed in 5 minutes 37 seconds (remote runner delay: 0 seconds).

Using arguments: regexdiff -NoPRLink
Main commit: dotnet/runtime@7e7296d
PR commit: stephentoub/runtime@727885a

ERROR: System.Exception: runtime/.dotnet/dotnet build src/libraries/System.Text.RegularExpressions/tests/FunctionalTests /t:Test -c Release /p:XUnitMethodName=System.Text.RegularExpressions.Tests.InjectedGenerateAllSourcesTestClass.GenerateAllSourcesAsync failed with exit code 1
   at Runner.JobBase.RunProcessAsync(String fileName, String arguments, List`1 output, String logPrefix, String workDir, Boolean checkExitCode, Func`2 processLogs, Boolean suppressOutputLogs, Boolean suppressStartingLog, ProcessPriorityClass priority, List`1 envVars, CancellationToken cancellationToken) in /app/JobBase.cs:line 487
   at Runner.Jobs.RegexDiffJob.RunSourceGeneratorOnKnownPatternsAsync(String branch) in /app/Jobs/RegexDiffJob.cs:line 246
   at Runner.Jobs.RegexDiffJob.RunJobCoreAsync() in /app/Jobs/RegexDiffJob.cs:line 107
   at Runner.JobBase.RunJobAsync() in /app/JobBase.cs:line 179
Sample source code for further analysis
const string JsonPath = "RegexResults-1821.json";
if (!File.Exists(JsonPath))
{
    await using var archiveStream = await new HttpClient().GetStreamAsync("");
    using var archive = new ZipArchive(archiveStream, ZipArchiveMode.Read);
    archive.Entries.First(e => e.Name == "Results.json").ExtractToFile(JsonPath);
}

using FileStream jsonFileStream = File.OpenRead(JsonPath);
RegexEntry[] entries = JsonSerializer.Deserialize<RegexEntry[]>(jsonFileStream, new JsonSerializerOptions { IncludeFields = true })!;
Console.WriteLine($"Working with {entries.Length} patterns");



record KnownPattern(string Pattern, RegexOptions Options, int Count);

sealed class RegexEntry
{
    public required KnownPattern Regex { get; set; }
    public required string MainSource { get; set; }
    public required string PrSource { get; set; }
    public string? FullDiff { get; set; }
    public string? ShortDiff { get; set; }
    public (string Name, string Values)[]? SearchValuesOfChar { get; set; }
    public (string[] Values, StringComparison ComparisonType)[]? SearchValuesOfString { get; set; }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions