This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env dotnet-script | |
| // Benchmark: RavenDB-25930 Compound Field Query Plan Degradation | |
| // | |
| // Demonstrates the performance impact of the `right is null` fix in | |
| // CoraxQueryBuilder.TrySetAsStreamingField(). Without the fix, a compound | |
| // field definition (Name, Count) incorrectly captures the query plan for | |
| // `WHERE Name = '1' AND Count > 100 ORDER BY Count`, preventing the | |
| // CoraxBooleanItem merge that produces an efficient UnaryMatch range scan. | |
| // | |
| // Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Checking BASE (http://127.0.0.1:18081)... OK {"BuildVersion":62,"ProductVersion":"6.2","CommitHash":"a377982","FullVersion":"6.2.14-custom-62"} | |
| Checking PR (http://127.0.0.1:18080)... OK {"BuildVersion":62,"ProductVersion":"6.2","CommitHash":"a377982","FullVersion":"6.2.14-custom-62"} | |
| ── Populating 3M databases ── | |
| BASE/Bench3M_Corax: 3,000,000 docs + index ready, skipping. | |
| PR/Bench3M_Corax: populating 3,000,000 docs (Corax)... | |
| 300,000 / 3,000,000 (7.4s) | |
| 600,000 / 3,000,000 (13.9s) | |
| 900,000 / 3,000,000 (20.3s) | |
| 1,200,000 / 3,000,000 (26.3s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using System.Net.Http; | |
| using System.Text; | |
| using System.Text.Json; | |
| using System.Threading.Tasks; | |
| // BASE (pre-PR) on 18081, PR on 18080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: john-carmack-synthesizer | |
| description: Use this agent when you need to cut through complexity and synthesize the essential truth from multiple inputs. This agent embodies John Carmack's engineering philosophy - first principles thinking, brutal honesty about trade-offs, and focus on what actually works. Examples: <example>Context: Multiple agents have provided conflicting recommendations about system architecture. user: "I have 5 different architectural proposals and need to decide which approach is actually best" assistant: "I'll use the john-carmack-synthesizer to cut through the complexity and identify the fundamental constraints and optimal solution." <commentary>When faced with multiple complex inputs, this agent strips away the noise to find the core engineering truth.</commentary></example> <example>Context: Team is over-engineering a solution with unnecessary abstractions. user: "Our trading system design has become overly complex with too many layers" assistant: "Let me use the john-carmack- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Linq; | |
| using System.Runtime.CompilerServices; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using BenchmarkDotNet.Analysers; | |
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Configs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Linq; | |
| using System.Runtime.CompilerServices; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using BenchmarkDotNet.Analysers; | |
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Configs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static ReadOnlySpan<byte> LoadMaskTable => new byte[] | |
| { | |
| 0xFF, 0xFF, 0xFF, 0xFF, | |
| 0xFF, 0xFF, 0xFF, 0xFF, | |
| 0xFF, 0xFF, 0xFF, 0xFF, | |
| 0xFF, 0xFF, 0xFF, 0xFF, | |
| 0xFF, 0xFF, 0xFF, 0xFF, | |
| 0xFF, 0xFF, 0xFF, 0xFF, | |
| 0xFF, 0xFF, 0xFF, 0xFF, | |
| 0xFF, 0xFF, 0xFF, 0xFF, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def init_weights(m, variance=1.0): | |
| def _calculate_fan_in_and_fan_out(tensor): | |
| dimensions = tensor.dim() | |
| if dimensions < 2: | |
| return 1, 1 | |
| if dimensions == 2: # Linear | |
| fan_in = tensor.size(1) | |
| fan_out = tensor.size(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Ralamb(Optimizer): | |
| def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0): | |
| defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weight_decay) | |
| self.buffer = [[None, None, None] for ind in range(10)] | |
| super(Ralamb, self).__init__(params, defaults) | |
| def __setstate__(self, state): | |
| super(Ralamb, self).__setstate__(state) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq; | |
| using System.Numerics; | |
| using System.Runtime.CompilerServices; | |
| using System.Runtime.Intrinsics.X86; | |
| using System.Runtime.InteropServices; | |
| using BenchmarkDotNet.Analysers; | |
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Columns; | |
| using BenchmarkDotNet.Configs; |
NewerOlder