From 749780298728904fab1a3cf5721819f33aae446c Mon Sep 17 00:00:00 2001 From: Atila Neves Date: Thu, 11 Dec 2025 17:43:42 +0100 Subject: [PATCH 1/2] Fix compilation with DIP1000 --- chimpfella/execute.d | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/chimpfella/execute.d b/chimpfella/execute.d index ac25581..93c7aff 100644 --- a/chimpfella/execute.d +++ b/chimpfella/execute.d @@ -22,7 +22,7 @@ public struct MetaExecution(ProcessBench) /+++ Execution Engine: - Takes multiple functions to be executed, however, they should be considered as a group, use multiple engines + Takes multiple functions to be executed, however, they should be considered as a group, use multiple engines for totally distinct functions. +/ private template DefaultExecutionEngine(string fullName, FuncPack...) @@ -93,7 +93,7 @@ private template DefaultExecutionEngine(string fullName, FuncPack...) static assert(hasMember!(typeof(theData), "pack"), "Since D does not have multiple return values this library requires that you return some\n - type containing + type containing an AliasSeq of values named \"pack\" which the library will expand for you"); const res = theFunc(theData.pack); } @@ -175,8 +175,8 @@ template ExecuteBenchmarks(alias fromHere) //pragma(msg, "\t", paramItem); //Work out what we're doing, then instantiate theFunc with it. - //Is it a type - + //Is it a type + //Parameter is fits the slot static if (__traits(compiles, symbol!paramItem)) { @@ -221,10 +221,10 @@ template ExecuteBenchmarks(alias fromHere) //pragma(msg, isInputRange!specRangeT); static assert(isInputRange!specRangeT && !isInfinite!(specRangeT), "not a valid parameter"); - //It's a range + //It's a range alias ElemT = ElementType!specRangeT; //pragma(msg, ElemT); - + static assert(__traits(compiles, symbol!(ElemT.init)), " symbol = " ~ fullyQualifiedName!symbol); import std.array : array; @@ -238,7 +238,7 @@ template ExecuteBenchmarks(alias fromHere) auto bench = theFunctionBench; static if(isSomeString!(typeof(ctRangeItem))) enum stringSummary = ctRangeItem; - else + else enum stringSummary = ctRangeItem.stringof; //Run the benchmark alias engine = DefaultExecutionEngine!( @@ -267,7 +267,7 @@ template ExecuteBenchmarks(alias fromHere) engine.runEngine!(MetaT, genInd, genFunc)(metaExecutionState, bench.measurementList); } - + } } @@ -276,7 +276,7 @@ template ExecuteBenchmarks(alias fromHere) } //A parameter can be a range, don't forget - //Can't introspect over the number of template parameters realistically. + //Can't introspect over the number of template parameters realistically. } else { @@ -371,10 +371,10 @@ unittest { return "cpuid;".repeat(n).join(); } - + enum cpuidRange = iota(1, 10).map!(ctfeRepeater).array; - @TemplateBenchmark!(0, cpuidRange) - @FunctionBenchmark!("Measure", iota(1, 10), (_) => [1, 2, 3, 4])(meas) + @TemplateBenchmark!(0, cpuidRange) + @FunctionBenchmark!("Measure", iota(1, 10), (_) => [1, 2, 3, 4])(meas) static int sum(string asmLine)(inout int[] input) { //This is quite fun because ldc will sometimes get rid of the entire function body and just loop over the asm's @@ -408,7 +408,7 @@ unittest writefln!"---------------%s---------------"(setName); auto counterPut = counters.map!(x => x.getHeader); //pragma(msg, ElementType!(typeof(counterPut))); - writeln("I;", counterPut.joiner!(typeof(counterPut)).joiner.joiner(";")); + () @trusted { writeln("I;", counterPut.joiner!(typeof(counterPut)).joiner.joiner(";")); }(); } void put(scope size_t[] data) From 657a910a583924b0026070cfcc6aad18a557fd42 Mon Sep 17 00:00:00 2001 From: Atila Neves Date: Thu, 11 Dec 2025 17:44:18 +0100 Subject: [PATCH 2/2] Add DIP1000 to the unittest configuration --- dub.sdl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dub.sdl b/dub.sdl index 80e70af..e025d13 100644 --- a/dub.sdl +++ b/dub.sdl @@ -14,4 +14,6 @@ configuration "library" { importPaths "chimpfella/" "chimpfella/measurement/" } - +configuration "unittest" { + dflags "-preview=dip1000" +}