Skip to content

Latest commit

 

History

History
355 lines (309 loc) · 27.7 KB

PORTING_STATUS.md

File metadata and controls

355 lines (309 loc) · 27.7 KB

Porting status

Last updated: 2026-10-18 (phase 1 complete; phase 2, the managed tensor engine: waves 1 and 2 of milestone M1 done).

Where the code came from

The repository started as the output of an automatic Java-to-VB.NET converter run over the whole Eclipse Deeplearning4j monorepo (DL4J, ND4J, DataVec, RL4J, python4j, contrib). That output never compiled:

  • Members generated by Lombok annotations (@Data, @AllArgsConstructor, @Getter, @Builder, @Slf4j) were simply missing, so most classes had no constructors, accessors or Equals.
  • Calls into Java libraries (java.util, Guava, Jackson, SLF4J, Apache Commons, JavaCPP) were left as they were.
  • Java constructs with no direct VB equivalent (wildcard generics, anonymous classes, get/set method names, varargs generics, Map.get) were emitted as syntax errors, and some whole methods were emitted as pseudo-Java inside If True Then blocks.
  • The generated project file was itself corrupted: 34 of the 4,960 include paths had a stray backslash inserted, so the compiler never even started.

Component names

DeepLearning4VB is for VB.NET developers, so the ported components carry "4vb" where the Java originals carry "4j":

Java original DeepLearning4VB
Deeplearning4j (DL4J), org.deeplearning4j DeepLearning4VB (DL4VB), DeepLearning4VB.org.deeplearning4vb
ND4J, org.nd4j ND4VB, DeepLearning4VB.org.nd4vb
RL4J, org.rl4j RL4VB (not ported yet)
DataVec, org.datavec DataVec, DeepLearning4VB.org.datavec (no "4j" in the name)

Class and constant names follow (ND4VBClassLoading, DL4VBResources, DL4VBSystemProperties), and so do the system-property and environment-variable names the library reads (org.nd4vb.*, org.deeplearning4vb.*, ND4VB_*, DL4VB_*). The default resource folder is ~/.deeplearning4vb. Unchanged on purpose: the dl4jdata download server (it is an external host), links to the upstream project, org.slf4j (the name of the third-party logging API the facade mimics), and the unported/ tree, which keeps the upstream Java names so each file can be compared with its Java original.

What is done

Area State
Solution and projects SDK-style .vbproj files targeting .NET Framework 4.8.1 and .NET 10 (net481;net10.0), .slnx solution for Visual Studio 2026, shared Directory.Build.props.
Library 1,041 source files, about 154,600 lines, zero errors and zero warnings on both target frameworks. Ported modules: nd4vb-common (all but four Java-only URL/VFS helpers), deeplearning4vb-common, datavec-api (all but the parts that need INDArray), datavec-local, and the first part of the phase-2 tensor engine (see below). JSON uses System.Text.Json (in the box on .NET 10, a NuGet package on .NET Framework).
Stand-ins for Java libraries A Joda-Time subset (org.joda.time), a t-digest (com.tdunning.math.stats.TDigest), a HyperLogLog++ distinct counter (com.clearspring.analytics.stream.cardinality.HyperLogLogPlus), java.util.concurrent.TimeUnit, and a binary object-graph serializer that replaces Java serialization and the BinaryFormatter.
Tests 220 test files, 1,430 tests, all passing on both target frameworks (two wait for the phase-2 Nd4vb factory and report as skipped): the upstream JUnit tests of the ported modules converted to MSTest, plus new tests for code the upstream tests did not cover.
Everything else Unchanged in unported/: 3,263 files, excluded from the build.

Module table

File counts are .vb files under unported/. "Needs" lists the external dependencies that block the module. INDArray means the module needs the ND4J tensor API, which the managed tensor engine of phase 2 will provide.

Module names are the upstream folder names under unported/; the ported code uses the "4vb" names.

Module (upstream name) Files left Needs Status
nd4j/nd4j-common 4 none Ported as nd4vb-common, except the four URL/VFS files listed below
deeplearning4j/deeplearning4j-common 0 none Ported as deeplearning4vb-common
datavec/datavec-api 22 INDArray Ported, except the INDArray files listed below
datavec/datavec-local 5 INDArray Ported, except two NDArray conversion functions and their tests
nd4j/nd4j-backends 1,812 native backend Phase 2. nd4j-api (1,409 files) is the tensor API to port; nd4j-native and nd4j-cuda are JavaCPP bindings to the C++ library, to be replaced by a managed engine; nd4j-tests are the reference tests.
nd4j/nd4j-serde, nd4j-common-tests 41 INDArray Phase 2, with the tensor API
deeplearning4j/deeplearning4j-nn 495 INDArray Phase 3: layers, networks, training
deeplearning4j/deeplearning4j-core 267 INDArray Phase 3: evaluation, early stopping, listeners
deeplearning4j/deeplearning4j-nlp-parent 198 INDArray Phase 3: Word2Vec, ParagraphVectors, tokenizers
deeplearning4j/deeplearning4j-modelimport 154 INDArray, HDF5 Phase 3: Keras model import (needs an HDF5 reader for .NET)
deeplearning4j/deeplearning4j-data 80 INDArray Phase 3: dataset iterators (MNIST, CIFAR, Iris, ...)
deeplearning4j/deeplearning4j-graph, deeplearning4j-zoo 78 INDArray Phase 3
deeplearning4j/deeplearning4j-scaleout 31 INDArray Phase 3: ParallelWrapper (single-machine parallel training and inference)
rl4j/rl4j-core, rl4j-api 258 INDArray Phase 3: reinforcement learning (RL4VB)
datavec/datavec-data 55 OpenCV (JavaCPP), INDArray Phase 3: image, audio and video record readers (needs a .NET imaging library)
nd4j/samediff-import 21 INDArray, TensorFlow/ONNX Phase 3: TensorFlow and ONNX graph import
deeplearning4j/dl4j-integration-tests 18 everything Last, as an end-to-end check
datavec/datavec-excel, datavec-jdbc 12 Apache POI, JDBC Small; port with the Open XML SDK and ADO.NET
datavec/datavec-arrow 10 Apache Arrow Later; the Apache.Arrow NuGet package covers it
deeplearning4j/deeplearning4j-ui-parent 109 Vert.x Later; replace the web dashboard with a simpler statistics export
deeplearning4j/deeplearning4j-cuda 19 CUDA Later; the managed engine is CPU-only at first
nd4j/nd4j-onnxruntime, nd4j-tensorflow, nd4j-tensorflow-lite, nd4j-tvm 16 native runtimes Later; use the ONNX Runtime NuGet package if inference is needed
deeplearning4j/deeplearning4j-common-tests 1 none Test helper; with phase 3

Phase 2 progress: the managed tensor engine

Phase 2 replaces nd4j-api + the native backend with the Java API ported to VB and a managed backend written in VB; docs/PHASE2_DESIGN.md has the design and milestones. Milestone M1 (an INDArray with element-wise operations) is being built in three waves.

Wave Contents State
1 Foundation API (161 files in org.nd4vb.linalg.* and org.nd4vb.enums: INDArray, DataBuffer, DataType, shape descriptors, memory/workspace interfaces, op interfaces, executioner interfaces, backend discovery, profiler, compression, schedules, exceptions); op math registry (managed.ops: the math of 171 of the 173 legacy ops, keyed by Java opName(), see docs/phase2/op-inventory.md); managed kernels (managed.storage typed storages, managed.kernels element-wise, broadcast, reduction, index reduction, summary statistics, TAD, BLAS gemm/gemv/level 1, xoshiro256** RNG) Done, 251 tests
2 Shape (the shape-info utility), indexing (NDArrayIndex, the index types, all conditions), linalg.util, ManagedShapeInfoProvider; data buffers (BaseDataBuffer, ManagedDataBuffer and its factory), memory and workspaces (Nd4vbWorkspace, the managed memory manager, workspace and workspace manager), the constant and TAD caches, ManagedRandom, the environment actions; DifferentialFunction, the op base classes and the 173 legacy op classes Done, 204 tests
3 BaseNDArray, NDArrayFactory, Nd4vb (Java's Nd4j), Transforms, the managed op executioner and backend, the M1 upstream tests, then the INDArray parts of DataVec After wave 2

Until wave 3 ports them, src/DeepLearning4VB/org/nd4vb/linalg/factory/Nd4vbStandIn.vb declares the members of Nd4vb, Broadcast and Transforms that wave-2 code calls; every one of them throws NotImplementedException. Wave 3 replaces the file with the real ports. The 403 custom op classes (DynamicCustomOp subclasses) are still in unported/; tools/porting has the script that converts op classes.

After M1 come reductions, BLAS and random numbers (M2), advanced indexing (M3), neural-network kernels (M4) and SameDiff (M5); together they unblock deeplearning4j-nn, deeplearning4j-core and everything above them.

Dropped modules

These wrapped Java-only platforms or native runtimes and were removed from unported/ with the owner's agreement: Spark training and ETL (deeplearning4j-scaleout/spark, datavec-spark), the Aeron parameter server and its ParallelWrapper bridge, python4j, the RL game environments (Doom, Malmo, ALE, Gym), the Solr modules and the Java contrib tools. ParallelWrapper itself (single-machine parallel training) is kept for phase 3.

Files left in unported/ by the ported modules

Module File(s) Why
nd4j-common io/AbstractFileResolvingResource, io/ResourceUtils Resolve jar:/file: URLs and URLConnections; ClassPathResource was re-implemented on search directories and embedded resources, so nothing needs them.
nd4j-common io/VfsUtils, io/VfsResource JBoss VFS reflection hooks; no .NET counterpart.
datavec-api writable/NDArrayWritable, writable/batch/NDArrayRecordBatch, util/ndarray/*, timeseries/util/*, transform/ndarray/*, transform/analysis/counter/NDArrayAnalysisCounter, transform/analysis/histogram/NDArrayHistogramCounter, transform/metadata/NDArrayMetaData, transform/transform/string/StringListTo*NDArrayTransform, vector/* Need INDArray (phase 2).
datavec-local misc/NDArrayToWritablesFunction, misc/WritablesToNDArrayFunction and their tests Need INDArray (phase 2).

The Jackson serializer/deserializer pairs for AtomicDouble/AtomicBoolean (primitives/serde) and for the t-digest (analysis/json) were dropped rather than deferred: System.Text.Json converters are subclasses of JsonConverter(Of T) whose Read method takes the ref struct Utf8JsonReader, and the VB.NET compiler cannot declare such a parameter. The DataVec JSON layer works around this with field-based contracts instead (see "JSON" below).

JSON

TransformProcess, Schema, DataAnalysis and everything they contain serialize to the same JSON as Java DataVec, so JSON written by Java loads here and the other way round (toJson/fromJson, or JsonMappers.getMapper for System.Text.Json directly):

  • Each class is written field by field under its Java field name, like Jackson with field visibility. Fields marked <NonSerialized> or <JsonIgnore> are skipped; <JsonIgnoreProperties("a", "b")> on a class skips fields by name (Jackson's semantics); <JsonPropertyName("javaName")> maps a VB field whose name differs from the Java field; <JsonIncludeNonNull> omits null fields; <JsonProperty("name")> names a <JsonConstructor> parameter after its Java JSON property.
  • Polymorphic base types (Transform, Condition, Filter, ColumnMetaData, Schema, the analyses, reducers, sequence operations, writables) carry <JsonClassType>, and values are written with "@class": "<Java class name>". IAssociativeReducer uses Java's wrapper-object form ({"Reducer": {...}}).
  • Implementations are discovered in every loaded assembly that references the library. Register your own types with JsonMappers.registerSubtype(GetType(MyTransform), "com.example.MyTransform") or JsonMappers.registerSubtypes(...).
  • Reading runs the <JsonConstructor> constructor with the matching JSON values (Jackson's creator), then restores the other fields and runs <OnDeserialized> methods. Unknown properties are ignored. The legacy pre-1.0 format (wrapper-object names) is converted on read.
  • Not identical to Java: a t-digest written by Java is a Java-serialized blob and is skipped with a warning; locale variants and scripts are not mapped; YAML is not supported (owner's decision).

Deliberate differences from the Java original

The port keeps Java behaviour wherever possible (including quirks such as ArrayUtil.range(5, 0) returning {4, 3, 2, 1, 0} and MathUtils.euclideanDistance returning the squared distance). These are the intentional exceptions.

Platform

  • Object serialization: SerializationUtils (Java's ObjectOutputStream/ObjectInputStream) uses DeepLearning4VB's own binary object-graph format (ObjectGraphSerializer) instead of the BinaryFormatter, which .NET 9 removed. It writes the fields of [Serializable] types (honouring [NonSerialized] and the serialization callbacks), keeps identity and cycles, handles the standard collections and Uri, CultureInfo, TimeZoneInfo, Encoding, Regex, BigInteger and Random explicitly, and writes type names without assembly names, so data moves between .NET Framework and .NET 10. Reading only creates [Serializable] types and the listed framework types. Delegate fields are not written. A Random keeps its state only on the same runtime. Data written by the BinaryFormatter in earlier versions cannot be read. Only read data from trusted sources.
  • Logging: org.slf4j.Logger/LoggerFactory is a minimal facade writing to System.Diagnostics.Trace; applications can replace it through LoggerFactory.Provider.
  • Integer arithmetic wraps on overflow (RemoveIntegerChecks in Directory.Build.props), matching Java, because hash and shape calculations rely on it.
  • Class loading: ND4VBClassLoading/DL4VBClassLoading search a configurable set of assemblies (default: every assembly loaded in the AppDomain) instead of a class loader, and loadService(Of S) returns explicitly registered instances (registerService) plus one instance of every concrete implementation with a public parameterless constructor that it can find.
  • Files and streams: java.io.File arguments are path strings, URIs are System.Uri, InputStream/OutputStream are Stream, PrintStream is TextWriter, byte[] is Byte() and Java byte is SByte. Locale is CultureInfo. Number formatting is culture invariant.
  • Downloads: Downloader retries inside one lock-file acquisition (the Java code recursed into the lock while holding it). file: URLs are copied locally; everything else is fetched with HttpClient (TLS 1.2 is enabled on .NET Framework).

nd4vb-common and deeplearning4vb-common

  • Lombok members are written out by hand. Pair, Triple, Quad and friends get a non-generic companion class so Pair.of(k, v) works without type arguments.
  • Preconditions: formatters are registered with Preconditions.registerFormat instead of being discovered through ServiceLoader. A custom tag at position 0 of a message is honoured (the Java code skipped it).
  • ArrayUtil: toBFloat16 implements the current upstream semantics; the 3-D/4-D toPrimitives overloads use the loop variable the Java code mixed up (infinite loop upstream); argsort is a stable sort; read/write take BinaryReader/BinaryWriter with big-endian byte order.
  • Counter/CounterMap: keySet(), entrySet() and the iterator work on snapshots, so removing while iterating is safe. CounterMap implements IEnumerable(Of Pair).
  • OneTimeLogger.reset() forgets the remembered messages as well as the buffer.
  • PropertyParser: malformed numbers throw JavaCompat.NumberFormatException, which derives from ArgumentException as Java's derives from IllegalArgumentException.
  • IntArrayKeyMap.IntArray is the top-level class IntArray.
  • ClassPathResource resolves a path first as a file under ClassPathResource.SearchDirectories (application base directory, current directory and their resources sub-folders, plus anything added with addSearchDirectory) and then as an embedded manifest resource.
  • StrumpfResolver passes the reference file (not its directory) to ResourceFile.fromFile, which the Java code got wrong.
  • ArchiveUtils uses a small built-in tar reader; zip entries that escape the destination directory are rejected. Like Java, unzipFileTo deletes the archive.
  • SynchronizedTable.get delegates to the wrapped table (the Java method called itself).
  • WeakIdentityHashMap sweeps collected keys on every operation instead of using a reference queue.
  • Spring utilities (io/StringUtils, ObjectUtils, CollectionUtils, Assert, ReflectionUtils): checked-exception helpers are constant, makeAccessible is a no-op, identity hash codes come from RuntimeHelpers.GetHashCode. Details are in each class's XML comments.
  • ValidationResult keeps Lombok's builder as ValidationResult.builder() returning a ValidationResultBuilder; Nd4vbCommonValidator validates JSON with JsonDocument.

Stand-ins for Java libraries

  • Joda-Time (org.joda.time): DateTimeZone wraps TimeZoneInfo; ids are UTC and its aliases, fixed offsets (+05:30), Windows zone ids and a built-in IANA-to-Windows table (extend it with DateTimeZone.addIanaMapping). DateTimeFormat.forPattern supports the Joda pattern letters; zone names (z) print but do not parse, and numeric fields not followed by another numeric field accept 1 to 9 digits.
  • t-digest (com.tdunning.math.stats.TDigest): a managed merging digest with the k1 scale function; it keeps roughly half as many centroids as the Java MergingDigest for the same compression but meets the same accuracy in the tests.
  • HyperLogLog++: the dense register representation only; the sparse precision sp is accepted and ignored, and the empirical bias-correction tables are not included.
  • JavaCompat.TimeUnit is an enum; toMillis, convert, sleep and friends are extension methods. TimeUnitValueOf replaces TimeUnit.valueOf.

datavec-api

  • Writables and I/O: URIUtil.getPath keeps Java's leading slash for Windows drive paths; TransformSplit.length() returns the source split's length; DataInputStream reads big-endian with proper widening; Configuration resources load from files, URIs or streams (XML).
  • Record readers: the Jackson readers read JSON only, through System.Text.Json. FileRecordWriter.close() may be called twice, as Java's streams allow.
  • Enums: the ...ValueOf helpers (ColumnTypeValueOf, ConditionOpValueOf, ResourceTypeValueOf, TimeUnitValueOf) reject numeric strings, which Enum.TryParse would accept.
  • Schemas: SequenceSchema.Builder.buildSequence() is a typed convenience on top of build().
  • Random order: the shuffling splits use System.Random, so a seed gives a different order than java.util.Random with the same seed.
  • Analysis: StatCounter.merge into an empty counter copies the variance (Java assigned it to the mean). Java's raw AnalysisCounter/QualityAnalysisState types are non-generic interfaces that the generic versions inherit. Java's saturating (int)/(long) casts are emulated where counters rely on them, and the string-quality patterns use Java's ASCII-only \d, \w, \s.
  • TransformProcess: YAML is not supported; errors surface as JsonException; inferCategories sorts ordinally; OverlappingTimeWindowFunction keeps its offset across a JSON round trip (Java's creator parameter never matched the field). The NDArray builder steps wait for phase 2.
  • HTML reports (transform/ui): rewritten without FreeMarker. HtmlAnalysis and HtmlSequencePlotting produce one self-contained page each (inline CSS and SVG, no scripts or external resources, light and dark themes, every data value HTML-encoded). Each column gets a statistics card with a histogram where the analysis has one; null or unparseable values leave gaps in sequence plots instead of throwing.

datavec-local

  • LocalTransformExecutor runs every step sequentially and deterministically: records keep their input order, groups (convert-to-sequence, reduce, join) come out in first-occurrence order of the key (Java used hash-map order), and sorts are stable. Java's final Apache Arrow round trip is replaced by converting each value directly to its final-schema column type.
  • Fixed Java bugs: empty input gives empty output (Java threw); try/catch mode drops the failed records (Java's filter was inverted and kept only the failed ones); executeJoin keeps a side that holds only key columns; convertWritableInputToString/convertStringInput return their results (Java returned empty lists); ReducerFunction uses a single aggregation (Java read the result from a fresh, empty one); AnalyzeLocal.analyzeQualitySequence no longer throws on the first time step.

nd4vb linalg (phase 2, in progress)

  • Memory: every buffer lives on the garbage-collected heap. Workspaces keep their API, scoping rules and exceptions, but only track scope, generations, cycles and statistics; MMAP workspaces map no file; DeallocatorService has no threads (it purges every 256 registrations and after invokeGc).
  • Data buffers: dup copies exactly (Java went through double and lost LONG values above 2^53); UTF8 buffers hold real UTF-8 strings, length counts strings, and they are written and read back (Java wrote no elements); UINT64 elements read back unsigned; HALF buffers can be created from arrays (the CPU factory threw).
  • Random numbers: ManagedRandom (xoshiro256**) is deterministic per seed but not bit-identical to libnd4j; DefaultRandom uses an MT19937 stand-in for Commons Math's MersenneTwister that matches the reference outputs.
  • Op classes: Java fields that clash with a method of the same name (VB names ignore case) carry a Field suffix (xField, dimensionsField, ...); the op-type property became getOpType(); BaseOp.GetHashCode is consistent with Equals (Java mixed in a random name).
  • Fixed Java bugs: IsFinite returned "is infinite", NotFinite missed NaN, EpsilonNotEquals tested equality, the epsilon conditions ignored their own epsilon, StableNumber threw for every finite number, DynamicCustomOp.removeIArgument never removed anything, a circular workspace could recurse forever, the allocations tracker released 1,024 bytes too few.
  • Names: environment variables are ND4VB_* (ND4VB_DEBUG, ND4VB_FALLBACK, ND4VB_VERBOSE, ...); ExecutorServiceProvider returns a TaskFactory and ParallelOptions and reads org.nd4vb.parallel.*.

Porting rules

Use these when moving the next file from unported/ to src/.

  1. Move the file from unported/<module>/src/main/java/org/<pkg>/Foo.vb to src/DeepLearning4VB/org/<pkg>/Foo.vb, applying the component rename (nd4j to nd4vb, deeplearning4j to deeplearning4vb). The namespace is the Java package (renamed) under the root namespace DeepLearning4VB.

  2. Fix the imports. Alias imports must be fully qualified: Imports Foo = DeepLearning4VB.org.nd4vb.common.base.Preconditions. Delete imports of lombok, org.apache.commons, org.nd4j.shade.* and java.*; use DeepLearning4VB.org.slf4j for logging.

  3. Write out what Lombok generated: constructors, getX/setX, Equals, GetHashCode, ToString. Prefer a VB property plus the Java-style accessor, so that both pair.First and pair.getFirst() work.

  4. Replace Java APIs. The common mappings:

    Java VB.NET in this repository
    map.get(k) map.GetValueOrNull(k) or TryGetValue; never the indexer (it throws)
    map.put(k, v) indexer, or LinkedHashMap.put when the previous value is needed
    new LinkedHashMap<>(), new LinkedHashSet<>() JavaCompat.LinkedHashMap(Of K, V), JavaCompat.LinkedHashSet(Of T)
    new PriorityQueue<>(cmp) JavaCompat.PriorityQueue(Of T)
    Properties JavaCompat.Properties
    Collections.synchronizedMap/Set JavaCompat.SynchronizedDictionary, SynchronizedSet
    Arrays.toString/copyOf/fill/asList/hashCode the Arrays module
    Collections.shuffle JavaCollections.shuffle
    Objects.equals/hash the Objects module
    Guava Ints, Longs the Ints, Longs modules
    String.format("%d %s") JavaString.format (same specifiers)
    System.getProperty, currentTimeMillis, nanoTime JavaSystem
    java.util.concurrent.atomic.* org.nd4vb.common.primitives.AtomicBoolean/AtomicDouble/Atomic
    java.util.concurrent.TimeUnit JavaCompat.TimeUnit
    ReentrantReadWriteLock ReaderWriterLockSlim
    ObjectOutputStream/ObjectInputStream org.nd4vb.common.util.SerializationUtils (never BinaryFormatter)
    Java streams, Guava Iterables LINQ
    Jackson annotations the JSON attributes described under "JSON"
    byte[] Byte()
    java.io.File path String (or FileInfo/DirectoryInfo)
    InputStream/OutputStream, PrintStream Stream, TextWriter
    NumberFormatException JavaCompat.NumberFormatException
    static <T> Foo<T> of(...) on a generic class the same method on a non-generic companion class (see Pair)
  5. VB specifics that bite:

    • Case-insensitive names. A field value and a property Value clash, as do builder() and a nested Builder, a local seq and a function Seq, or a test method named like a type. A Java-style getType() member hides Object.GetType(): write CObj(x).GetType().
    • The root namespace. org.deeplearning4vb matches the root namespace DeepLearning4VB, so a fully qualified name written in code (not in an Imports line) must start with Global. (Global.DeepLearning4VB.org.datavec...).
    • Name shadowing. VB looks up names in the enclosing namespaces before Imports aliases, so inside org.datavec.api.transform.* the name Schema resolves to the namespace transform.schema ("Type expected"). Use aliases with a T suffix (Imports SchemaT = DeepLearning4VB.org.datavec.api.transform.schema.Schema, WritableT, ConditionT) or qualified names. The test project has the same issue with its own namespaces.
    • Boxed value types are copied whenever they pass through an Object variable, so code that fills a boxed struct by reflection must hold it in a ValueType variable.
    • Keywords used as identifiers (get, set, single, when, step, end) must be bracketed or renamed; Call New Foo().bar() is needed when a lambda's body starts with New.
    • Numbers. Java integer division and (int) casts truncate, VB CInt rounds half to even; Java's Collections.sort is stable, List.Sort is not (use OrderBy); String.matches is a whole-string match (\A(?:...)\z).
    • Zero warnings on both frameworks. Mark intended hiding with Shadows/Overloads. Type.IsSerializable is obsolete on .NET 10 (tests use isSerializableType), and code that only works on one framework goes inside #If NETFRAMEWORK Then.
  6. The VB compiler reports method-body errors only after every declaration-level error in the project is fixed, so expect two or three waves of errors per file.

  7. Port the matching test from unported/<module>/src/test into tests/DeepLearning4VB.Tests. TestSupport/Assertions.vb provides JUnit-style assertEquals/assertTrue/assertThrows helpers with Java collection-equality semantics, so the tests keep their original shape. Run the tests on both frameworks (dotnet test DeepLearning4VB.slnx does).

  8. Record any behaviour that deliberately differs from Java in the list above.