Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 8 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,19 @@ jobs:

steps:
- name: Checkout repository
uses: actions/[email protected]
uses: actions/checkout@v7
with:
submodules: recursive

- name: Setup .NET
uses: actions/setup-dotnet@v4.3.1
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json

- name: Build basis_universal native library
shell: pwsh
run: .\source\CapriKit.SuperCompressed\basis_universal\build.ps1

- name: Run unit tests
shell: pwsh
run: dotnet test
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "external/basis_universal"]
path = external/basis_universal
url = https://github.com/BinomialLLC/basis_universal.git
ignore = untracked
23 changes: 19 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
# CLAUDE.md

See `RESPONSIBLE_USE_OF_AI.md` to read how I use AI agents and tools in this repository.
Read `RESPONSIBLE_USE_OF_AI.md` to understand how I use AI agents and tools in this repository.

## Instructions
You are an AI agent working on C# NuGet packages that aid the creation of videogames and game engines. You are working together with myself, an experienced software engineer who has created multiple game engines before working on this project. Your tasks is to assist me in chores and research. This is a hobby project, the most important things is that I learn new things and understand what is going on in the code. Keep all your replies short and to the point. If you are asked to generate code,keep changes as small as possible. Focus on creating small, maintainable and easy to understand code. Work in small iterative steps and ensure the test in `Caprikit.Tests` cover the happy path of any code generated.
You are an AI agent working on C# NuGet packages that aid the creation of videogames and game engines. You are working with an experienced software engineer who has created multiple game engines before working on this project. Your tasks is to assist me in chores and research. This is a hobby project, the most important thing is that I learn new things and understand what is going on in the code.

## Responses
When answering a question keep the following rules in mind:
- Do not open with a (flattering) preamble ("Great question")
- Do not restate my question back to me
- Limit the usual summary or recap that you always put at the end of an answer to one line
- Code examples are helpful, but they do not have to be complete or to compile. Use a comment like `// snip` to elude boilerplate code.

## Code
If you are asked to generate code,keep changes as small as possible. Focus on creating small, maintainable and easy to understand code. Work in small iterative steps and ensure the test in `Caprikit.Tests` cover the happy path of any code generated and follow the test guidelines found in `source\CapriKit.Tests\README.md`. When generating interop code for C or C++ libraries try to create stateless (functional style) code that mimicks the API of the native library but hides native pointers from the public C# API. Double check that any collection or other action by the garbage collector does not invalidate pointers.

## Documentation
When generating documentation focus on the target audiance: The code maintainers and library users. Write XML documentation to educate the library users on how to use a class, method, property or other component correctly and in which situations it should be used or not be used. Sparingly use in-line comments to explain gotcha's, non-obvious behavior or future points of improvemnts to code maintainers. Remember that documentation also needs to be maintained so focus on writing short to-the-point documentation that is easy for me to maintain.

## Environment
Assume you can only use Powershell to execute commands, the `dotnet` tool and latest version of the .NET SDK are available to you. The primary language we use is C#, shaders are written in HLSL. See `README.md` in the root project for build, run, test and lint commands. Consult `README.md` files in subdirectories to learn the quirks and implementation details of individual projects.
Assume you can only use Powershell to execute commands. The `dotnet` tool and latest version of the .NET SDK are available to you. The primary language we use is C#, shaders are written in HLSL. See `README.md` in the root project for build, run, test and lint commands. Consult `README.md` files in subdirectories to learn the quirks and implementation details of individual projects. Some projects build or interop with native C/C++ libraries. For those projects use `cmake`.

The `external` folder in the root of the repository contains git submodules that point to external repositories. You can depend on code in these external repositories but you can never make changes to them.

## Technologies
See `Directory.Packages.props` for an overview of NuGet packages used.
See `Directory.Packages.props` for an overview of NuGet packages used.
5 changes: 4 additions & 1 deletion CapriKit.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<Project Path="source/CapriKit.Build/CapriKit.Build.csproj">
<Platform Project="x64" />
</Project>
<Project Path="source/CapriKit.Concurrency/CapriKit.Concurrency.csproj" Id="ea1d18e3-af9b-4a08-8e53-6a98d653e326">
<Project Path="source/CapriKit.Concurrency/CapriKit.Concurrency.csproj">
<Platform Project="x64" />
</Project>
<Project Path="source/CapriKit.DirectX11/CapriKit.DirectX11.csproj">
Expand All @@ -50,6 +50,9 @@
<Project Path="source/CapriKit.Meta/CapriKit.Meta.csproj">
<Platform Project="x64" />
</Project>
<Project Path="source/CapriKit.SuperCompressed/CapriKit.SuperCompressed.csproj">
<Platform Project="x64" />
</Project>
<Project Path="source/CapriKit.Win32/CapriKit.Win32.csproj">
<Platform Project="x64" />
</Project>
Expand Down
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.287" />
<PackageVersion Include="Spectre.Console.Cli" Version="0.55.0" />
<PackageVersion Include="StbImageSharp" Version="2.30.15" />
<PackageVersion Include="TrxFileParser" Version="4.3.0" />
<PackageVersion Include="TUnit" Version="1.53.0" />
<PackageVersion Include="Vortice.D3DCompiler" Version="3.8.3" />
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ _Roy Triesscheijn's collection of code libraries_

## Goal

I have been writing code since 2003. I started in Visual Basic 6 and I switched to C# code since 2007. Since then I have written thousands of lines of code. Most of that code was barely tested and sits in forgotten repositories.
I have been writing code since 2003. I started in Visual Basic 6 and I switched to C# code in 2007. Since then I have written thousands of lines of code. Most of that code was barely tested and sits in forgotten repositories.

With CapriKit I try to make a library where I gather all code that I find relevant and through documentation and testing I try to make it reusable and have lasting value. For myself, and maybe for others. Most of the code is focussed on game engine development as that is my favorite hobby.

## How to Build, Run, Test and Lint
In general you can use the standard .net commands. These examples here assume you are using `powershell`. (when using Git Bash the `/` characters in
When checking out ensure that you also checkout and update all submodules using:

```pwsh
git submodule update --init --recursive
```
In general you can use the standard .net commands. These examples here assume you are using `powershell`.

```pwsh
# build the solution
Expand All @@ -42,13 +47,12 @@ dotnet format # format code
dotnet run --project <the project>
```

For native C and C++ libraries (like the basis_universal submodule) I use `cmake` and powershell based build scripts.

> [!WARNING]
> These examples assume you are using `powershell`. When using Git Bash the `/` characters are silently converted to `\`, making the commands fail. Use powershell or set `MSYS_NO_PATHCONV=1` to work around this problem.

> [!NOTE]
> This project uses non-standard output directories. See the `.build` directory in the root of this repository. This keeps all source code in the `source` folder clean.

There is a command line utility called `CapriKit.Meta` that assist in publishing in a consistent way. It also contains utilities to run benchmarks and to compare if those results significantly differ from previous versions. Build the project in DEBUG mode and run it from `.build\bin\CapriKit.Meta-Debug\CapriKit.Meta.exe`.

## TODO
Investigate making all libraries AOT Compatible `<IsAotCompatible>true</IsAotCompatible>` but if something, like a LightInject cannot be made AOT compatible it will not work. Otherwise suggest compiling with ReadyToRun on the consumer side which is mixed tier-0 compiled code with JIT. (The tier-0 code will slowly be Jitted to more optimized code, thought that can be disabled to avoid hitches).
2 changes: 1 addition & 1 deletion RESPONSIBLE_USE_OF_AI.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

My work gives me access to AI tools to analyze how they work and how they change the software development process. I sometimes use these tools in my hobby projects to asses them. So you will see commits made by various tools and agents. I also have a personal Claude Code license that I use on a more regular basis to aid me with this project.

This is a hobby project where I want to have fun and learn new things. There are no deadlines, so I don't feel the urge to optimize my time. Instead I want to experiment, learn new things, understand everything, and curate this code base as if it is a beautiful 'bonsai-tree'. I love the zen-like feeling I get from writing code myself and I often find myself coming up with simpler and more elegant solutions than those generated by AI tools. Sometimes I generate larger pieces of code to understand how a certain architecture or pattern 'feels' or because it is easier to improve existing work than staring at a blank canvas. But, in general I limit my use of AI to chores (like generating tests) and research (see the research folder, where I sometimes let the AI dump text files that I want to investigate later).
This is a hobby project where I want to have fun and learn new things. There are no deadlines, so I don't feel the urge to optimize my time. Instead I want to experiment, learn new things, understand everything, and curate this code base as if it is a beautiful 'bonsai-tree'. I love the zen-like feeling I get from writing code myself and I often find myself coming up with simpler and more elegant solutions than those generated by AI tools. Sometimes I generate larger pieces of code such as an interop layer for a C/C++ library, to understand how a certain architecture or pattern 'feels' or because it is easier to improve existing work than staring at a blank canvas. But, in general I limit my use of AI to chores (like generating tests) and research (see the research folder, where I sometimes let the AI dump ideas that I want to investigate later).

Merge requests created using AI on this repository are allowed, if the creator can articulate their understanding of the problem they are trying to solve. There's no need to accompany a merge request with a 5 page description with bullet points and emojis.
9 changes: 9 additions & 0 deletions external/BASIS_UNIVERSAL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Basis Universal

Git Submodule for https://github.com/BinomialLLC/basis_universal

## Building
1. Install cmake (tested 2026-07-09 on commit `1b33fd5` with cmake version 4.3.4)
2. Go to the `basis_universal/build` directory
3. Run `cmake ..`
4. Open `basis_universal/basisu.slnx` and build the `ALL_BUILD` project.
9 changes: 9 additions & 0 deletions external/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# External

This folder contains git submodules that point to external repositories. Do not make any changes in the subfolders of this `external` directory.

If you do not see any subfolders run:

```
git submodule update --init --recursive
```
1 change: 1 addition & 0 deletions external/basis_universal
Submodule basis_universal added at 1b33fd
113 changes: 0 additions & 113 deletions research/AsyncContentPipeline.md

This file was deleted.

Loading