Skip to content

Commit 587e73d

Browse files
committed
Update CLAUDE.md for net8.0/net10.0 upgrade
- Script template: add AllowUnsafeBlocks=true directive and document why it's needed (NumSharp uses unsafe extensively) - Linear algebra Q&A: note LAPACK bindings were removed, decomposition methods are stubs returning null/default - Target framework Q&A: update from "netstandard2.0" to "net8.0 and net10.0 multi-target" - Dependencies Q&A: note System.Memory and System.Runtime.CompilerServices.Unsafe are now built into the runtime, no external runtime dependencies remain
1 parent 0e463ad commit 587e73d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.claude/CLAUDE.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,16 @@ NumSharp has many key types/fields/methods marked `internal` (Shape.dimensions,
327327

328328
**How it works:** NumSharp declares `[assembly: InternalsVisibleTo("NumSharp.DotNetRunScript")]` in `src/NumSharp.Core/Assembly/Properties.cs`. The `#:property AssemblyName=NumSharp.DotNetRunScript` directive overrides the script's assembly name (which normally derives from the filename) to match, granting full access to all `internal` and `protected internal` members.
329329

330+
### Accessing Unsafe code
331+
NumSharp uses unsafe in many places, hence include `#:property AllowUnsafeBlocks=true` in scripts.
332+
330333
### Script Template (copy-paste ready)
331334

332335
```csharp
333336
#:project path/to/src/NumSharp.Core
334337
#:property AssemblyName=NumSharp.DotNetRunScript
335338
#:property PublishAot=false
336-
339+
#:property AllowUnsafeBlocks=true
337340
```
338341

339342
### Quick One-Liners
@@ -473,7 +476,7 @@ A: Element-wise comparisons (`==`, `!=`, `>`, `<`, etc.) return `NDArray<bool>`.
473476
A: Integer indices, string slices (`"1:3, :"`), Slice objects, boolean masks, fancy indexing (NDArray<int> indices), and mixed combinations. All in `Selection/NDArray.Indexing*.cs`.
474477

475478
**Q: How is linear algebra implemented?**
476-
A: Core ops (`dot`, `matmul`) in `LinearAlgebra/`. Advanced decompositions (`inv`, `qr`, `svd`, `lstsq`) use LAPACK bindings in `Backends/LAPACK/`.
479+
A: Core ops (`dot`, `matmul`) in `LinearAlgebra/`. Advanced decompositions (`inv`, `qr`, `svd`, `lstsq`) are stub methods that return null/default — the LAPACK native bindings they depended on have been removed.
477480

478481
---
479482

@@ -483,10 +486,10 @@ A: Core ops (`dot`, `matmul`) in `LinearAlgebra/`. Advanced decompositions (`inv
483486
A: MSTest framework in `test/NumSharp.UnitTest/`. Many tests adapted from NumPy's own test suite. Decent coverage but gaps in edge cases.
484487

485488
**Q: What .NET version is targeted?**
486-
A: Library targets .NET Standard 2.0 for broad compatibility. Tests run on .NET 8.0.
489+
A: Library and tests multi-target `net8.0` and `net10.0`. Dropped `netstandard2.0` in the dotnet810 branch upgrade.
487490

488491
**Q: What are the main dependencies?**
489-
A: `System.Memory` (4.5.5) and `System.Runtime.CompilerServices.Unsafe` (6.0.0).
492+
A: No external runtime dependencies. `System.Memory` and `System.Runtime.CompilerServices.Unsafe` (previously NuGet packages) are built into the .NET 8+ runtime.
490493

491494
**Q: What projects use NumSharp?**
492495
A: TensorFlow.NET, ML.NET integrations, Gym.NET, Pandas.NET, and various scientific computing projects.

0 commit comments

Comments
 (0)