Skip to content

Dev p3.0/param testcases #879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: major/P3.0
Choose a base branch
from
Open

Conversation

ChristineZh0u
Copy link
Contributor

Merging param test cases branch into major 3.0

zhezhouzz and others added 28 commits June 11, 2024 13:58
* update assumption

* fix: add deps back

* refactor: constant -> param

* fix

* clean the code

* unify normal/param/assume tests

* clean the code

* rename

* merging safety test parser rules

* clean the code

* Update github CI action v2 to v3

* iUpdate github CI action v2 to v3 on ubuntu

* rename variable "param" into "parameter" to avoid keyword conflicts
* add twise

* clean the code
* Solved Concerns from Lewis:

+ new allow twise number be 1
+ unify twise number valid condition
+ add unit test

* add new test case

* unit test for ParamAssignment.IterateAssignments
* Update build system and Java compiler, remove dependency JARs

* Update CheckerCore logging and state machine components
@@ -24,4 +24,10 @@ jobs:
- name: Build
run: dotnet build --configuration Release
- name: Test
run: dotnet test --configuration Release
run: dotnet test --configuration Release --blame-crash --blame-hang --blame-hang-timeout 300s --logger:"console;verbosity=detailed"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is to get better logs when the GitHub Action fails. Without it, we just see that something crashed, but not what caused it. With these flags, we get more detailed output and can tell which test hung or crashed, which makes debugging a lot easier.

@@ -190,7 +190,7 @@ public static TestingEngine Create(CheckerConfiguration checkerConfiguration, As
Console.Out.WriteLine($"{mi.DeclaringType.Name}");
}

Environment.Exit(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed because, for parametric tests, we have to fetch all the test case names using this function. The problem is that it calls Environment.Exit(0), which ends the entire regression test run early. So we had to handle it differently to avoid stopping the whole suite.

@@ -21,7 +22,8 @@ public class PCheckerCodeGenerator : ICodeGenerator
/// This compiler has a compilation stage.
/// </summary>
public bool HasCompilationStage => true;
private static List<Variable> _globalParams = [];
[ThreadStatic]
private static List<Variable> _globalParams;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing issues when I ran regression tests in parallel. Since _globalParams was static, all the tests were sharing the same list, which led to conflicts. Adding [ThreadStatic] makes sure each test thread gets its own copy, so they don’t mess with each other.

@@ -102,6 +104,7 @@ private CompiledFile GenerateSource(CompilationContext context, Scope globalScop
// write the top level declarations
foreach (var decl in globalScope.AllDecls)
{
// Console.WriteLine("top-level decl: " + decl.Name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make a pass to remove unwanted changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants