Skip to content
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

[automated] Merge branch 'release/8.0-rc2' => 'release/8.0' #92325

Merged
8 changes: 6 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@
<Sha>89be445dd4936157533ad96bafb95f701430653a</Sha>
<SourceBuild RepoName="cecil" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport" Version="8.0.0-rtm.23469.3">
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport" Version="8.0.0-rtm.23470.1">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>50bf805c8b5ca52abd34fde390609d8a54640246</Sha>
<Sha>446eeb331fcbf2f48c14a377601a8ab950ec942e</Sha>
<SourceBuild RepoName="emsdk" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="8.0.0-alpha.1.23469.1">
Expand Down Expand Up @@ -398,5 +398,9 @@
<Uri>https://github.com/NuGet/NuGet.Client</Uri>
<Sha>8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8</Sha>
</Dependency>
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="8.0.100-rc.2.23470.7">
<Uri>https://github.com/dotnet/installer</Uri>
<Sha>dbeae1ac71d95355452952059f35960991cb3fd2</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
7 changes: 4 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@
<GrpcCoreVersion>2.46.3</GrpcCoreVersion>
<GrpcDotnetClientVersion>2.45.0</GrpcDotnetClientVersion>
<GrpcToolsVersion>2.45.0</GrpcToolsVersion>
<!-- Uncomment to set a fixed version, else the latest is used -->
<SdkVersionForWorkloadTesting>8.0.100-rc.1.23415.5</SdkVersionForWorkloadTesting>
<CompilerPlatformTestingVersion>1.1.2-beta1.23323.1</CompilerPlatformTestingVersion>
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>8.0.0-preview-20230918.1</MicrosoftPrivateIntellisenseVersion>
Expand Down Expand Up @@ -240,7 +238,7 @@
Note: when the name is updated, make sure to update dependency name in eng/pipelines/common/xplat-setup.yml
like - DarcDependenciesChanged.Microsoft_NET_Workload_Emscripten_Current_Manifest-8_0_100_Transport
-->
<MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>8.0.0-rtm.23469.3</MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>
<MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>8.0.0-rtm.23470.1</MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>
<MicrosoftNETRuntimeEmscriptenVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion)</MicrosoftNETRuntimeEmscriptenVersion>
<!-- workloads -->
<SwixPackageVersion>1.1.87-gba258badda</SwixPackageVersion>
Expand All @@ -257,5 +255,8 @@
<!-- BrowserDebugProxy libs -->
<MicrosoftExtensionsLoggingVersion>3.1.7</MicrosoftExtensionsLoggingVersion>
<MicrosoftSymbolStoreVersion>1.0.406601</MicrosoftSymbolStoreVersion>
<!-- installer version, for testing workloads -->
<MicrosoftDotnetSdkInternalVersion>8.0.100-rc.2.23470.7</MicrosoftDotnetSdkInternalVersion>
<SdkVersionForWorkloadTesting>$(MicrosoftDotnetSdkInternalVersion)</SdkVersionForWorkloadTesting>
</PropertyGroup>
</Project>
1,001 changes: 678 additions & 323 deletions src/coreclr/gc/gc.cpp

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/coreclr/gc/gcconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class GCConfigStringHolder
INT_CONFIG (BGCSpinCount, "BGCSpinCount", NULL, 140, "Specifies the bgc spin count") \
INT_CONFIG (BGCSpin, "BGCSpin", NULL, 2, "Specifies the bgc spin time") \
INT_CONFIG (HeapCount, "GCHeapCount", "System.GC.HeapCount", 0, "Specifies the number of server GC heaps") \
INT_CONFIG (MaxHeapCount, "GCMaxHeapCount", "System.GC.MaxHeapCount", 0, "Specifies the max number of server GC heaps to adjust to") \
INT_CONFIG (Gen0Size, "GCgen0size", NULL, 0, "Specifies the smallest gen0 budget") \
INT_CONFIG (SegmentSize, "GCSegmentSize", NULL, 0, "Specifies the managed heap segment size") \
INT_CONFIG (LatencyMode, "GCLatencyMode", NULL, -1, "Specifies the GC latency mode - batch, interactive or low latency (note that the same " \
Expand Down
93 changes: 67 additions & 26 deletions src/coreclr/gc/gcpriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,6 @@ struct GCDebugSpinLock {
#if defined(DYNAMIC_HEAP_COUNT)
// time in microseconds we wait for the more space lock
uint64_t msl_wait_time;
// number of times we wait for the more space lock
uint64_t msl_wait_count;
#endif //DYNAMIC_HEAP_COUNT

GCDebugSpinLock()
Expand All @@ -415,7 +413,7 @@ struct GCDebugSpinLock {
, num_switch_thread(0), num_wait_longer(0), num_switch_thread_w(0), num_disable_preemptive_w(0)
#endif
#if defined(DYNAMIC_HEAP_COUNT)
, msl_wait_time(0), msl_wait_count(0)
, msl_wait_time(0)
#endif //DYNAMIC_HEAP_COUNT
{
}
Expand Down Expand Up @@ -1148,15 +1146,12 @@ class dynamic_data
//
// The following 3 fields are updated at the beginning of each GC, if that GC condemns this generation.
//
// The number of GC that condemned this generation. The only difference between this
// and collection_count is just that collection_count is maintained for all physical generations
// (currently there are 5) whereas this is only updated for logical generations (there are 3).
size_t gc_clock;
uint64_t time_clock; //time when this gc started
size_t gc_clock; // the gc index
uint64_t time_clock; // time when this gc started
uint64_t previous_time_clock; // time when previous gc started

// Updated at the end of a GC, if that GC condemns this generation.
size_t gc_elapsed_time; // Time it took for the gc to complete
size_t gc_elapsed_time; // time it took for the gc to complete

//
// The following fields (and fields in sdata) are initialized during GC init time and do not change.
Expand Down Expand Up @@ -1495,6 +1490,8 @@ class mark_queue_t
void verify_empty();
};

float median_of_3 (float a, float b, float c);

//class definition of the internal class
class gc_heap
{
Expand Down Expand Up @@ -2422,6 +2419,7 @@ class gc_heap
#ifndef USE_REGIONS
PER_HEAP_METHOD void rearrange_heap_segments(BOOL compacting);
#endif //!USE_REGIONS
PER_HEAP_METHOD void delay_free_segments();
PER_HEAP_ISOLATED_METHOD void distribute_free_regions();
#ifdef BACKGROUND_GC
PER_HEAP_ISOLATED_METHOD void reset_write_watch_for_gc_heap(void* base_address, size_t region_size);
Expand Down Expand Up @@ -2597,11 +2595,17 @@ class gc_heap
// re-initialize a heap in preparation to putting it back into service
PER_HEAP_METHOD void recommission_heap();

PER_HEAP_ISOLATED_METHOD size_t get_num_completed_gcs();

PER_HEAP_ISOLATED_METHOD int calculate_new_heap_count();

// check if we should change the heap count
PER_HEAP_METHOD void check_heap_count();

PER_HEAP_METHOD bool prepare_to_change_heap_count (int new_n_heaps);
PER_HEAP_ISOLATED_METHOD bool prepare_to_change_heap_count (int new_n_heaps);
PER_HEAP_METHOD bool change_heap_count (int new_n_heaps);

PER_HEAP_ISOLATED_METHOD size_t get_msl_wait_time();
#endif //DYNAMIC_HEAP_COUNT
#endif //USE_REGIONS

Expand Down Expand Up @@ -3778,6 +3782,13 @@ class gc_heap
PER_HEAP_FIELD_MAINTAINED mark* loh_pinned_queue;
#endif //FEATURE_LOH_COMPACTION

#ifdef DYNAMIC_HEAP_COUNT
PER_HEAP_FIELD_MAINTAINED GCEvent gc_idle_thread_event;
#ifdef BACKGROUND_GC
PER_HEAP_FIELD_MAINTAINED GCEvent bgc_idle_thread_event;
#endif //BACKGROUND_GC
#endif //DYNAMIC_HEAP_COUNT

/******************************************/
// PER_HEAP_FIELD_MAINTAINED_ALLOC fields //
/******************************************/
Expand Down Expand Up @@ -4084,7 +4095,6 @@ class gc_heap
// These 2 fields' values do not change but are set/unset per GC
PER_HEAP_ISOLATED_FIELD_SINGLE_GC GCEvent gc_start_event;
PER_HEAP_ISOLATED_FIELD_SINGLE_GC GCEvent ee_suspend_event;
PER_HEAP_ISOLATED_FIELD_SINGLE_GC GCEvent gc_idle_thread_event;

// Also updated on the heap#0 GC thread because that's where we are actually doing the decommit.
PER_HEAP_ISOLATED_FIELD_SINGLE_GC BOOL gradual_decommit_in_progress_p;
Expand Down Expand Up @@ -4163,6 +4173,10 @@ class gc_heap
PER_HEAP_ISOLATED_FIELD_SINGLE_GC uint8_t* gc_high; // high end of the highest region being condemned
#endif //USE_REGIONS

#ifdef STRESS_DYNAMIC_HEAP_COUNT
PER_HEAP_ISOLATED_FIELD_SINGLE_GC int heaps_in_this_gc;
#endif //STRESS_DYNAMIC_HEAP_COUNT

/**************************************************/
// PER_HEAP_ISOLATED_FIELD_SINGLE_GC_ALLOC fields //
/**************************************************/
Expand Down Expand Up @@ -4261,37 +4275,65 @@ class gc_heap
#endif //USE_REGIONS

#ifdef DYNAMIC_HEAP_COUNT
// Sample collection -
//
// For every GC, we collect the msl wait time + GC pause duration info and use both to calculate the
// throughput cost percentage. We will also be using the wait time and the GC pause duration separately
// for other purposes in the future.
//
// For all gen2 GCs we also keep a separate array currently just for the GC cost. This serves as a backstop
// to smooth out the situation when we rarely pick the gen2 GCs in the first array.
struct dynamic_heap_count_data_t
{
static const int sample_size = 3;

struct sample
{
uint64_t elapsed_between_gcs; // time between gcs in microseconds
uint64_t gc_elapsed_time; // time the gc took
uint64_t soh_msl_wait_time; // time the allocator spent waiting for the soh msl lock
uint64_t uoh_msl_wait_time; // time the allocator spent waiting for the uoh msl lock
size_t allocating_thread_count;// number of allocating threads
size_t heap_size;
uint64_t elapsed_between_gcs; // time between gcs in microseconds (this should really be between_pauses)
uint64_t gc_pause_time; // pause time for this GC
uint64_t msl_wait_time;
};

unsigned sample_index;
uint32_t sample_index;
sample samples[sample_size];
size_t prev_num_completed_gcs;

uint32_t gen2_sample_index;
// This is (gc_elapsed_time / time inbetween this and the last gen2 GC)
float gen2_gc_percents[sample_size];

float median_percent_overhead; // estimated overhead of allocator + gc
float smoothed_median_percent_overhead; // exponentially smoothed version
float percent_heap_space_cost_per_heap; // percent space cost of adding a heap
float overhead_reduction_per_step_up; // percentage effect on overhead of increasing heap count
float overhead_increase_per_step_down; // percentage effect on overhead of decreasing heap count
float space_cost_increase_per_step_up; // percentage effect on space of increasing heap count
float space_cost_decrease_per_step_down;// percentage effect on space of decreasing heap count
float median_throughput_cost_percent; // estimated overhead of allocator + gc
float smoothed_median_throughput_cost_percent; // exponentially smoothed version
float percent_heap_space_cost_per_heap; // percent space cost of adding a heap
float tcp_reduction_per_step_up; // throughput cost percent effect of increasing heap count
float tcp_increase_per_step_down; // throughput cost percent effect of decreasing heap count
float scp_increase_per_step_up; // space cost percent effect of increasing heap count
float scp_decrease_per_step_down; // space cost percent effect of decreasing heap count

int new_n_heaps;
// the heap count we changed from
int last_n_heaps;
// don't start a GC till we see (n_max_heaps - new_n_heaps) number of threads idling
VOLATILE(int32_t) idle_thread_count;
bool init_only_p;

bool should_change_heap_count;
int heap_count_to_change_to;
int heap_count_change_count;
#ifdef STRESS_DYNAMIC_HEAP_COUNT
int lowest_heap_with_msl_uoh;
#endif //STRESS_DYNAMIC_HEAP_COUNT

float get_median_gen2_gc_percent()
{
return median_of_3 (gen2_gc_percents[0], gen2_gc_percents[1], gen2_gc_percents[2]);
}
};
PER_HEAP_ISOLATED_FIELD_MAINTAINED dynamic_heap_count_data_t dynamic_heap_count_data;
PER_HEAP_ISOLATED_FIELD_MAINTAINED uint64_t last_suspended_end_time;
// If the last full GC is blocking, this is that GC's index; for BGC, this is the settings.gc_index
// when the BGC ended.
PER_HEAP_ISOLATED_FIELD_MAINTAINED size_t gc_index_full_gc_end;
#endif //DYNAMIC_HEAP_COUNT

/****************************************************/
Expand Down Expand Up @@ -4867,7 +4909,6 @@ uint64_t& dd_previous_time_clock (dynamic_data* inst)
return inst->previous_time_clock;
}


inline
size_t& dd_gc_clock_interval (dynamic_data* inst)
{
Expand Down
7 changes: 7 additions & 0 deletions src/coreclr/jit/emitxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5485,6 +5485,13 @@ void emitter::emitInsRMW(instruction ins, emitAttr attr, GenTreeStoreInd* storeI
{
assert(!src->isContained()); // there must be one non-contained src

if (addr->isContained() && addr->OperIs(GT_LCL_ADDR))
{
GenTreeLclVarCommon* lclVar = addr->AsLclVarCommon();
emitIns_S_R(ins, attr, src->GetRegNum(), lclVar->GetLclNum(), lclVar->GetLclOffs());
return;
}

// ind, reg
id = emitNewInstrAmd(attr, offset);
emitHandleMemOp(storeInd, id, emitInsModeFormat(ins, IF_ARD_RRD), ins);
Expand Down
9 changes: 0 additions & 9 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10807,8 +10807,6 @@ GenTree* Compiler::fgOptimizeHWIntrinsic(GenTreeHWIntrinsic* node)
}

#if defined(TARGET_XARCH)
case NI_AVX512F_Add:
case NI_AVX512BW_Add:
case NI_AVX512F_And:
case NI_AVX512DQ_And:
case NI_AVX512F_AndNot:
Expand Down Expand Up @@ -10850,13 +10848,6 @@ GenTree* Compiler::fgOptimizeHWIntrinsic(GenTreeHWIntrinsic* node)

switch (intrinsicId)
{
case NI_AVX512F_Add:
case NI_AVX512BW_Add:
{
maskIntrinsicId = NI_AVX512F_AddMask;
break;
}

case NI_AVX512F_And:
case NI_AVX512DQ_And:
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ private static bool TryValidateOptions(object options, string qualifiedName, Lis

foreach (PropertyInfo propertyInfo in options.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public))
{
if (propertyInfo.GetMethod is null)
// Indexers are properties which take parameters. Ignore them.
if (propertyInfo.GetMethod is null || propertyInfo.GetMethod.GetParameters().Length > 0)
{
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,30 @@ public void TestValidationWithEnumeration()
result2.Failures);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
public void TestObjectsWithIndexerProperties()
{
DataAnnotationValidateOptions<MyDictionaryOptions> dataAnnotationValidateOptions1 = new("MyDictionaryOptions");
MyDictionaryOptionsOptionsValidator sourceGenOptionsValidator1 = new();

var options1 = new MyDictionaryOptions();
ValidateOptionsResult result1 = sourceGenOptionsValidator1.Validate("MyDictionaryOptions", options1);
ValidateOptionsResult result2 = dataAnnotationValidateOptions1.Validate("MyDictionaryOptions", options1);

Assert.True(result1.Succeeded);
Assert.True(result2.Succeeded);

DataAnnotationValidateOptions<MyListOptions<string>> dataAnnotationValidateOptions2 = new("MyListOptions");
MyListOptionsOptionsValidator sourceGenOptionsValidator2 = new();

var options2 = new MyListOptions<string>() { Prop = "test" };
result1 = sourceGenOptionsValidator2.Validate("MyListOptions", options2);
result2 = dataAnnotationValidateOptions2.Validate("MyListOptions", options2);

Assert.True(result1.Succeeded);
Assert.True(result2.Succeeded);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
public void TestValidationWithCyclicReferences()
{
Expand Down Expand Up @@ -302,6 +326,12 @@ public partial class MySourceGenOptionsValidator : IValidateOptions<MyOptions>
{
}

public class MyDictionaryOptions : Dictionary<string, string> { [Required] public string Prop { get; set; } = "test"; }
[OptionsValidator] public partial class MyDictionaryOptionsOptionsValidator : IValidateOptions<MyDictionaryOptions> { }

public class MyListOptions<T> : List<T> { [Required] public T Prop { get; set; } = default; }
[OptionsValidator] public partial class MyListOptionsOptionsValidator : IValidateOptions<MyListOptions<string>> { }

#if NET8_0_OR_GREATER
public class OptionsUsingNewAttributes
{
Expand Down
9 changes: 9 additions & 0 deletions src/mono/wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,12 @@ npm update --lockfile-version=1
| Multi-thread | linux: build only | none |

* `high resource aot` runs a few specific library tests with AOT, that require more memory to AOT.


# Perf pipeline

TBD

## Updates needed

- when the base OS is upgraded, check if the version of node installed in the `eng/pipelines/coreclr/templates/run-performance-job.yml` needs an upgrade too.
4 changes: 2 additions & 2 deletions src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static class MyDllImports
public static extern int cpp_add(int a, int b);
}}";

File.WriteAllText(Path.Combine(_projectDir!, "Pages", "MyDllImport.cs"), myDllImportCs);
File.WriteAllText(Path.Combine(_projectDir!, "Components", "Pages", "MyDllImport.cs"), myDllImportCs);

AddItemsPropertiesToProject(projectFile, extraItems: @"<NativeFileReference Include=""mylib.cpp"" />");
BlazorAddRazorButton("cpp_add", """
Expand Down Expand Up @@ -144,7 +144,7 @@ public void BugRegression_60479_WithRazorClassLib()
Assert.Contains(razorClassLibraryFileName, lazyVal.EnumerateObject().Select(jp => jp.Name));
}

private void BlazorAddRazorButton(string buttonText, string customCode, string methodName = "test", string razorPage = "Pages/Counter.razor")
private void BlazorAddRazorButton(string buttonText, string customCode, string methodName = "test", string razorPage = "Components/Pages/Counter.razor")
{
string additionalCode = $$"""
<p role="{{methodName}}">Output: @outputText</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public async Task WorkloadNotRequiredForInvariantGlobalization(string config, bo
if (invariant)
AddItemsPropertiesToProject(projectFile, extraProperties: "<InvariantGlobalization>true</InvariantGlobalization>");

string counterPath = Path.Combine(Path.GetDirectoryName(projectFile)!, "Pages", "Counter.razor");
string counterPath = Path.Combine(Path.GetDirectoryName(projectFile)!, "Components", "Pages", "Counter.razor");
string allText = File.ReadAllText(counterPath);
string ccText = "currentCount++;";
if (allText.IndexOf(ccText) < 0)
Expand Down
Loading
Loading