Skip to content

Fix GameState #93

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

Merged
merged 1 commit into from
Mar 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions VSharp.IL/Serializer.fs
Original file line number Diff line number Diff line change
@@ -488,15 +488,20 @@ let collectGameState (basicBlocks: ResizeArray<BasicBlock>) filterStates =
for term in pathCondition do
pathConditionDelta.AddRange(collectPathCondition term)

State(
s.Id,
(uint <| s.CodeLocation.offset - currentBasicBlock.StartOffset + 1<byte_offset>)
* 1u<byte_offset>,
let pathConditionRoot =
PathConditionVertex(
id = getFirstFreePathConditionVertexId (),
pathConditionVertexType = pathConditionVertexType.PathConditionRoot,
children = [| for p in pathCondition -> pathConditionVertices.[p].Id |]
),
)

pathConditionDelta.Add pathConditionRoot

State(
s.Id,
(uint <| s.CodeLocation.offset - currentBasicBlock.StartOffset + 1<byte_offset>)
* 1u<byte_offset>,
pathConditionRoot,
s.VisitedAgainVertices,
s.VisitedNotCoveredVerticesInZone,
s.VisitedNotCoveredVerticesOutOfZone,

Unchanged files with check annotations Beta

var methodName = t.Last();
var x = type.GetMethods(Reflection.allBindingFlags);
method ??= x
.Where(m => type.FullName.Split('.').Last().Contains(className) && m.Name.Contains(methodName))

Check warning on line 96 in VSharp.Runner/RunnerProgram.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 96 in VSharp.Runner/RunnerProgram.cs

GitHub Actions / build

Dereference of a possibly null reference.
.MinBy(m => m.Name.Length);
if (method != null)
break;
parseResult.GetValueForOption(verbosityOption),
parseResult.GetValueForOption(recursionThresholdOption),
parseResult.GetValueForOption(explorationModeOption),
parseResult.GetValueForOption(pathToModelOption),

Check warning on line 533 in VSharp.Runner/RunnerProgram.cs

GitHub Actions / build

Possible null reference argument for parameter 'pathToModel' in 'void RunnerProgram.EntryPointHandler(FileInfo assemblyPath, string[]? args, int timeout, int solverTimeout, DirectoryInfo output, bool renderTests, bool runTests, SearchStrategy strat, Verbosity verbosity, uint recursionThreshold, ExplorationMode explorationMode, string pathToModel, bool useGPU, bool optimize)'.

Check warning on line 533 in VSharp.Runner/RunnerProgram.cs

GitHub Actions / build

Possible null reference argument for parameter 'pathToModel' in 'void RunnerProgram.EntryPointHandler(FileInfo assemblyPath, string[]? args, int timeout, int solverTimeout, DirectoryInfo output, bool renderTests, bool runTests, SearchStrategy strat, Verbosity verbosity, uint recursionThreshold, ExplorationMode explorationMode, string pathToModel, bool useGPU, bool optimize)'.
parseResult.GetValueForOption(useGPUOption),
parseResult.GetValueForOption(optimizeOption)
);
parseResult.GetValueForOption(verbosityOption),
parseResult.GetValueForOption(recursionThresholdOption),
parseResult.GetValueForOption(explorationModeOption),
parseResult.GetValueForOption(pathToModelOption),

Check warning on line 597 in VSharp.Runner/RunnerProgram.cs

GitHub Actions / build

Possible null reference argument for parameter 'pathToModel' in 'void RunnerProgram.AllPublicMethodsHandler(FileInfo assemblyPath, int timeout, int solverTimeout, DirectoryInfo output, bool renderTests, bool runTests, SearchStrategy strat, Verbosity verbosity, uint recursionThreshold, ExplorationMode explorationMode, string pathToModel, bool useGPU, bool optimize)'.

Check warning on line 597 in VSharp.Runner/RunnerProgram.cs

GitHub Actions / build

Possible null reference argument for parameter 'pathToModel' in 'void RunnerProgram.AllPublicMethodsHandler(FileInfo assemblyPath, int timeout, int solverTimeout, DirectoryInfo output, bool renderTests, bool runTests, SearchStrategy strat, Verbosity verbosity, uint recursionThreshold, ExplorationMode explorationMode, string pathToModel, bool useGPU, bool optimize)'.
parseResult.GetValueForOption(useGPUOption),
parseResult.GetValueForOption(optimizeOption)
);
parseResult.GetValueForOption(verbosityOption),
parseResult.GetValueForOption(recursionThresholdOption),
parseResult.GetValueForOption(explorationModeOption),
parseResult.GetValueForOption(pathToModelOption),

Check warning on line 627 in VSharp.Runner/RunnerProgram.cs

GitHub Actions / build

Possible null reference argument for parameter 'pathToModel' in 'void RunnerProgram.PublicMethodsOfTypeHandler(FileInfo assemblyPath, string typeName, int timeout, int solverTimeout, DirectoryInfo output, bool renderTests, bool runTests, SearchStrategy strat, Verbosity verbosity, uint recursionThreshold, ExplorationMode explorationMode, string pathToModel, bool useGPU, bool optimize)'.

Check warning on line 627 in VSharp.Runner/RunnerProgram.cs

GitHub Actions / build

Possible null reference argument for parameter 'pathToModel' in 'void RunnerProgram.PublicMethodsOfTypeHandler(FileInfo assemblyPath, string typeName, int timeout, int solverTimeout, DirectoryInfo output, bool renderTests, bool runTests, SearchStrategy strat, Verbosity verbosity, uint recursionThreshold, ExplorationMode explorationMode, string pathToModel, bool useGPU, bool optimize)'.
parseResult.GetValueForOption(useGPUOption),
parseResult.GetValueForOption(optimizeOption)
);
parseResult.GetValueForOption(verbosityOption),
parseResult.GetValueForOption(recursionThresholdOption),
parseResult.GetValueForOption(explorationModeOption),
pathToModel,

Check warning on line 660 in VSharp.Runner/RunnerProgram.cs

GitHub Actions / build

Possible null reference argument for parameter 'pathToModel' in 'void RunnerProgram.SpecificMethodHandler(FileInfo assemblyPath, string methodName, int timeout, int solverTimeout, DirectoryInfo output, bool renderTests, bool runTests, bool checkCoverage, SearchStrategy strat, Verbosity verbosity, uint recursionThreshold, ExplorationMode explorationMode, string pathToModel, bool useGPU, bool optimize)'.

Check warning on line 660 in VSharp.Runner/RunnerProgram.cs

GitHub Actions / build

Possible null reference argument for parameter 'pathToModel' in 'void RunnerProgram.SpecificMethodHandler(FileInfo assemblyPath, string methodName, int timeout, int solverTimeout, DirectoryInfo output, bool renderTests, bool runTests, bool checkCoverage, SearchStrategy strat, Verbosity verbosity, uint recursionThreshold, ExplorationMode explorationMode, string pathToModel, bool useGPU, bool optimize)'.
parseResult.GetValueForOption(useGPUOption),
parseResult.GetValueForOption(optimizeOption)
);
stepsLimit: options.StepsLimit,
aiAgentTrainingOptions: options.AIAgentTrainingOptions == null ? FSharpOption<AIAgentTrainingOptions>.None : FSharpOption<AIAgentTrainingOptions>.Some(options.AIAgentTrainingOptions),
pathToModel: options.PathToModel == null ? FSharpOption<string>.None : FSharpOption<string>.Some(options.PathToModel),
useGPU: options.UseGPU == null ? FSharpOption<bool>.None : FSharpOption<bool>.Some(options.UseGPU),

Check warning on line 196 in VSharp.API/VSharp.cs

GitHub Actions / build

The result of the expression is always 'false' since a value of type 'bool' is never equal to 'null' of type 'bool?'

Check warning on line 196 in VSharp.API/VSharp.cs

GitHub Actions / build

The result of the expression is always 'false' since a value of type 'bool' is never equal to 'null' of type 'bool?'
optimize: options.Optimize == null ? FSharpOption<bool>.None : FSharpOption<bool>.Some(options.Optimize)

Check warning on line 197 in VSharp.API/VSharp.cs

GitHub Actions / build

The result of the expression is always 'false' since a value of type 'bool' is never equal to 'null' of type 'bool?'

Check warning on line 197 in VSharp.API/VSharp.cs

GitHub Actions / build

The result of the expression is always 'false' since a value of type 'bool' is never equal to 'null' of type 'bool?'
);
var fuzzerOptions =
// TODO: merging!
type memoryRegion<'key, 'reg when 'key : equality and 'key :> IMemoryKey<'key, 'reg> and 'reg : equality and 'reg :> IRegion<'reg>> with
override x.ToString() = MemoryRegion.toString "" x

Check warning on line 788 in VSharp.SILI.Core/MemoryRegion.fs

GitHub Actions / build

Override implementations in augmentations are now deprecated. Override implementations should be given as part of the initial declaration of a type.

Check warning on line 788 in VSharp.SILI.Core/MemoryRegion.fs

GitHub Actions / build

Override implementations in augmentations are now deprecated. Override implementations should be given as part of the initial declaration of a type.
type setKeyWrapper<'key when 'key : equality> =
{key : 'key}
returnType = types.Last();
}
var declaringType = mi.DeclaringType;
return declaringType.GetProperty(propertyName, Reflection.allBindingFlags, null, returnType, argumentTypes, null) != null;

Check warning on line 152 in VSharp.TestRenderer/CodeRenderer.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 152 in VSharp.TestRenderer/CodeRenderer.cs

GitHub Actions / build

Dereference of a possibly null reference.
}
propertyName = string.Empty;
// NOTE: first 16 bytes contain array meta info
public const int ArrayElementsOffset = 16;
public static readonly int StringElementsOffset = RuntimeHelpers.OffsetToStringData;

Check warning on line 56 in VSharp.CSharpUtils/LayoutUtils.cs

GitHub Actions / build

'RuntimeHelpers.OffsetToStringData' is obsolete: 'OffsetToStringData has been deprecated. Use string.GetPinnableReference() instead.'

Check warning on line 56 in VSharp.CSharpUtils/LayoutUtils.cs

GitHub Actions / build

'RuntimeHelpers.OffsetToStringData' is obsolete: 'OffsetToStringData has been deprecated. Use string.GetPinnableReference() instead.'
}
}