
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
@fluidframework/matrix
Advanced tools
SharedMatrix is a rectangular 2D array of values. Matrix values are a superset of JSON serializable types that includes embedded IFluidHandle references to Fluid object.
The SharedMatrix currently supports the following operations:
insertCols(col, numCols) / removeCols(col, numCols)insertRows(row, numRows) / removeRows(row, numRows)setCells(row, col, numCols, values) (values is a 1D array in row-major order)Insertion / removal operations are reconciled using Fluid sequence semantics, while setCells() uses Fluid map semantics.
The SharedMatrix data structure is comprised of:
The 'PermutationVectors' provide a layer of indirection between the current logical row/col (e.g., R2) and the [x,y]
coordinate in the physical store where the cell value is stored.
For example, to store the following matrix:
A B C D <- logical col
+--------
1 | . . . 3
logical row -> 2 | . . . .
3 | 8 . . .
4 | C . . F
The SparseMatrix allocates 3 rows and 2 columns from the physical storage:
0 . . 1 <- column allocs
+--------
0 | . . . 3
. | . . . .
row allocs -> 1 | 8 . . .
2 | C . . F
And writes the cell values to these locations:
0 1 <- physical col
+----
0 | . 3
physical row -> 1 | 8 .
2 | C F
The next row/column to be inserted is assigned the next available physical address, regardless of where the row/col was logically inserted. Deleted rows/cols are recycled after clearing the physical store.
This indirection between logical row/col and storage row/col provides three functions:
To support reconciliation, we use a MergeTree for each PermutationVector. MergeTree is a B-Tree of order 7 that temporarily maintains some extra metadata to reconcile ops while they are within the current collab window.
Cell data is stored in a quadtree-like data structure that is a recursive subdivision of 16x16 tiles. The implementation leverages Morton coding to implement this as a cascade of fast 1D array accesses.
const keyHi = r0c0ToMorton2x16(row >>> 16, col >>> 16);
const keyLo = r0c0ToMorton2x16((row << 16) >>> 16, (col << 16) >>> 16);
const level0 = this.root[keyHi];
if (level0 !== undefined) {
const level1 = level0[byte0(keyLo)];
if (level1 !== undefined) {
const level2 = level1[byte1(keyLo)];
if (level2 !== undefined) {
const level3 = level2[byte2(keyLo)];
if (level3 !== undefined) {
return level3[byte3(keyLo)];
}
}
}
}
return undefined; // Empty region
A benefit of storing the cell data in Z-order is that both row-major and col-major traversal benefit from prefetching and cache coherence. Reading/writing to the physical storage along either axis is typically within an order of magnitude compared to sequentially accessing a cache hot native JavaScript array.
FAQs
Distributed matrix
The npm package @fluidframework/matrix receives a total of 791 weekly downloads. As such, @fluidframework/matrix popularity was classified as not popular.
We found that @fluidframework/matrix demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.