Add custom job scheduling and dependency combiners

- Introduce `CombinedDependenciesJob` for efficient dependency handling and memory management
- Add `ScheduleCustom<T>` for user-defined job execution/free logic
- Refactor `JobInfo` and `JobDataPool<T>` for safer resource management and custom function support
- Improve SPMD extension type constraint formatting
- Update SPMD project content path and increment assembly versions
- Add unit tests for combined dependencies and custom jobs
- Remove `[Timeout]` from tests to prevent spurious failures
- Add TODO for future `WideLane` optimizations
- Replace legacy .sln with .slnx for better solution structure
This commit is contained in:
2026-05-03 15:17:19 +09:00
parent 997aab299c
commit fe8362e029
16 changed files with 230 additions and 219 deletions

View File

@@ -54,9 +54,9 @@ public struct JobRanges
public unsafe ref struct CustomJobDesc<T>
{
public required ref readonly T data;
public required delegate*<int, int, ref JobRanges, ref readonly JobExecutionContext, void> pExecutionFunc;
public required delegate*<int, int, void> pFreeFunc;
public required ref T data;
public required delegate*<ref T, ref JobRanges, ref readonly JobExecutionContext, void> pExecutionFunc;
public required delegate*<ref T, void> pFreeFunc;
public JobRanges jobRanges;
public JobPriority priority;
}
@@ -104,7 +104,10 @@ internal unsafe struct JobInfo
}
public delegate*<int, int, ref JobRanges, ref readonly JobExecutionContext, void> pExecutionFunc;
public delegate*<int, int, void> pFreeFunc;
public delegate*<ref readonly JobInfo, void> pFreeFunc;
public void* pCustomExecutionFunc;
public void* pCustomFreeFunc;
public int dataID;
public int dataGeneration;
@@ -118,7 +121,7 @@ internal unsafe struct JobInfo
public int dependencyCount; // Numbers of jobs that this job depends on, when it reaches 0, the job can be executed
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public DependentIterator GetDependentIterator(ReadOnlySpan<JobEdge> edgePool)
public readonly DependentIterator GetDependentIterator(ReadOnlySpan<JobEdge> edgePool)
{
return new DependentIterator(firstDependentEdgeIndex, edgePool);
}