dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
8.93k stars 1.86k forks source link

DataFrame incorrectly sets column value for index higher than Buffer.MaxCapacity #6847

Closed asmirnov82 closed 9 months ago

asmirnov82 commented 9 months ago

DataFrame incorrectly sets column value for index higher than Buffer.MaxCapacity.

Steps to reproduce

Run the code:

var length = DataFrameBuffer<T>.MaxCapacity + 5;
var column = new PrimitiveDataFrameColumn<byte>("LargeColumn", length);
var index = length - 1;
column[index] = 33;

var value1 = column[index];
var value2 = column[index %  DataFrameBuffer<T>.MaxCapacity];

Expected result:

value1 == 33 value2 == null;

Actual result:

value1 == null value2 == 0;