From 7b7385779dd61d09d67d85567d5d2d81fda68e45 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 15 May 2026 08:36:41 +0000 Subject: [PATCH 1/6] feat: add `ndarray/base/trues-like` Adds the `@stdlib/ndarray/base/trues-like` package, which creates an ndarray filled with `true` values and having the same shape and data type as a provided ndarray. Follows the same pattern as `@stdlib/ndarray/base/falses-like`. Also registers `truesLike` in the `@stdlib/ndarray/base` namespace. https://claude.ai/code/session_01PxFKbuUFyEW22kNL6XbQ1p --- .ralph/state.md | 58 +++++ .../@stdlib/ndarray/base/lib/index.js | 9 + .../@stdlib/ndarray/base/trues-like/README.md | 143 ++++++++++++ .../base/trues-like/benchmark/benchmark.js | 79 +++++++ .../benchmark/benchmark.size.bool.js | 96 +++++++++ .../benchmark/benchmark.size.generic.js | 96 +++++++++ .../ndarray/base/trues-like/docs/repl.txt | 31 +++ .../base/trues-like/docs/types/index.d.ts | 61 ++++++ .../base/trues-like/docs/types/test.ts | 50 +++++ .../ndarray/base/trues-like/examples/index.js | 41 ++++ .../ndarray/base/trues-like/lib/index.js | 54 +++++ .../ndarray/base/trues-like/lib/main.js | 61 ++++++ .../ndarray/base/trues-like/package.json | 68 ++++++ .../ndarray/base/trues-like/test/test.js | 203 ++++++++++++++++++ 14 files changed, 1050 insertions(+) create mode 100644 .ralph/state.md create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/README.md create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.bool.js create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.generic.js create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/examples/index.js create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/lib/index.js create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/lib/main.js create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/package.json create mode 100644 lib/node_modules/@stdlib/ndarray/base/trues-like/test/test.js diff --git a/.ralph/state.md b/.ralph/state.md new file mode 100644 index 000000000000..202447eb7c7c --- /dev/null +++ b/.ralph/state.md @@ -0,0 +1,58 @@ +# Ralph Loop State + +## Issue +GitHub issue #2777 (stdlib-js/todo): Review `@stdlib/ndarray/base/trues-like` + +Issue text: "Review `@stdlib/ndarray/base/trues-like`." + +This is a "review" issue meaning the package needs to be created (it does not exist yet). + +## Acceptance Criteria +- [ ] Package `@stdlib/ndarray/base/trues-like` exists at `lib/node_modules/@stdlib/ndarray/base/trues-like/` +- [ ] `lib/index.js` — barrel export +- [ ] `lib/main.js` — implementation: `truesLike(x)` returns `fill(emptyLike(x), true)` +- [ ] `package.json` — correct metadata, name, keywords +- [ ] `examples/index.js` — runnable example +- [ ] `test/test.js` — comprehensive tests (invalid input, bool base/non-base, generic base/non-base, zero-dim, empty) +- [ ] `docs/repl.txt` — REPL documentation +- [ ] `docs/types/index.d.ts` — TypeScript declarations +- [ ] `docs/types/test.ts` — TypeScript tests +- [ ] `benchmark/benchmark.js` — base benchmark +- [ ] `benchmark/benchmark.size.bool.js` — size benchmark for bool +- [ ] `benchmark/benchmark.size.generic.js` — size benchmark for generic +- [ ] `README.md` — package documentation +- [ ] `@stdlib/ndarray/base` namespace index (`lib/node_modules/@stdlib/ndarray/base/lib/index.js`) registers `truesLike` +- [ ] All tests pass +- [ ] Examples run without error + +## Make Commands +- Test a package: `NODE_PATH=/home/user/stdlib/lib/node_modules node /home/user/stdlib/lib/node_modules/@stdlib/ndarray/base/trues-like/test/test.js` +- Run examples: `NODE_PATH=/home/user/stdlib/lib/node_modules node /home/user/stdlib/lib/node_modules/@stdlib/ndarray/base/trues-like/examples/index.js` +- Run benchmark: `NODE_PATH=/home/user/stdlib/lib/node_modules node /home/user/stdlib/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.js` + +## Hypothesis +The package needs to be created from scratch following the `falses-like` pattern exactly (since `falses-like` is the direct analogue of `trues-like`). + +Key design decision: use `emptyLike(x)` + `fill(_, true)` (same as `falsesLike` uses `false`, same as `onesLike` uses `1.0`). + +Supported dtypes: `bool` and `generic` only (same as `trues` and `falses`/`falses-like`). + +TypeScript type: `T extends typedndarray` (same as `falsesLike`). + +## Files Touched +- lib/node_modules/@stdlib/ndarray/base/trues-like/ (new package, all files) +- lib/node_modules/@stdlib/ndarray/base/lib/index.js (add truesLike entry after trues) + +## Open Questions +None. + +## Review Findings +(pending first review) + +## Decision Log +- Using `falses-like` as primary reference (not `ones-like`) because it supports the same boolean/generic dtype subset. +- `truesLike(x)` fills with `true`, `falsesLike(x)` fills with `false` — symmetric pattern. +- Index registration: insert `truesLike` after `trues` in `ndarray/base/lib/index.js` (alphabetically correct). + +## Iteration 1 +**Goal: Implement** — create all package files, register in namespace, run tests. diff --git a/lib/node_modules/@stdlib/ndarray/base/lib/index.js b/lib/node_modules/@stdlib/ndarray/base/lib/index.js index f248dfad81b7..53ab4a8d4881 100644 --- a/lib/node_modules/@stdlib/ndarray/base/lib/index.js +++ b/lib/node_modules/@stdlib/ndarray/base/lib/index.js @@ -1723,6 +1723,15 @@ setReadOnly( ns, 'transpose', require( '@stdlib/ndarray/base/transpose' ) ); */ setReadOnly( ns, 'trues', require( '@stdlib/ndarray/base/trues' ) ); +/** +* @name truesLike +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/ndarray/base/trues-like} +*/ +setReadOnly( ns, 'truesLike', require( '@stdlib/ndarray/base/trues-like' ) ); + /** * @name unary * @memberof ns diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/README.md b/lib/node_modules/@stdlib/ndarray/base/trues-like/README.md new file mode 100644 index 000000000000..39bc2e1704f3 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/README.md @@ -0,0 +1,143 @@ + + +# truesLike + +> Create an ndarray filled with `true` values and having the same shape and [data type][@stdlib/ndarray/dtypes] as a provided ndarray. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var truesLike = require( '@stdlib/ndarray/base/trues-like' ); +``` + +#### truesLike( x ) + +Creates an ndarray filled with `true` values and having the same shape and [data type][@stdlib/ndarray/dtypes] as a provided ndarray. + +```javascript +var getShape = require( '@stdlib/ndarray/shape' ); +var empty = require( '@stdlib/ndarray/empty' ); + +var x = empty( [ 2, 2 ], { + 'dtype': 'bool' +}); +// returns + +var y = truesLike( x ); +// returns [ [ true, true ], [ true, true ] ] + +var sh = getShape( y ); +// returns [ 2, 2 ] +``` + +
+ + + + + +
+ +## Notes + +- Along with data type, shape, and order, the function infers the "class" of the returned ndarray from the provided ndarray. For example, if provided a "base" [ndarray][@stdlib/ndarray/base/ctor], the function returns a base [ndarray][@stdlib/ndarray/base/ctor]. If provided a non-base [ndarray][@stdlib/ndarray/ctor], the function returns a non-base [ndarray][@stdlib/ndarray/ctor]. + +
+ + + + + +
+ +## Examples + + + +```javascript +var empty = require( '@stdlib/ndarray/empty' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var truesLike = require( '@stdlib/ndarray/base/trues-like' ); + +// Specify a list of data types: +var dt = [ + 'generic', + 'bool' +]; + +// Generate true-filled arrays... +var x; +var y; +var i; +for ( i = 0; i < dt.length; i++ ) { + x = empty( [ 2, 2 ], { + 'dtype': dt[ i ] + }); + y = truesLike( x ); + console.log( ndarray2array( y ) ); +} +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.js new file mode 100644 index 000000000000..725d3513e841 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.js @@ -0,0 +1,79 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); +var empty = require( '@stdlib/ndarray/empty' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var truesLike = require( './../lib' ); + + +// MAIN // + +bench( format( '%s:dtype=generic', pkg ), function benchmark( b ) { + var x; + var y; + var i; + + x = empty( [ 0 ], { + 'dtype': 'generic' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = truesLike( x ); + if ( y.length !== 0 ) { + b.fail( 'should have length 0' ); + } + } + b.toc(); + if ( !isndarrayLike( y ) ) { + b.fail( 'should return an ndarray' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( format( '%s:dtype=bool', pkg ), function benchmark( b ) { + var x; + var y; + var i; + + x = empty( [ 0 ], { + 'dtype': 'bool' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = truesLike( x ); + if ( y.length !== 0 ) { + b.fail( 'should have length 0' ); + } + } + b.toc(); + if ( !isndarrayLike( y ) ) { + b.fail( 'should return an ndarray' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.bool.js b/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.bool.js new file mode 100644 index 000000000000..0174bc33bd85 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.bool.js @@ -0,0 +1,96 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); +var trues = require( '@stdlib/ndarray/base/trues' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var truesLike = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = trues( 'bool', [ len ], 'row-major' ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var arr; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + arr = truesLike( x ); + if ( arr.length !== len ) { + b.fail( 'unexpected length' ); + } + } + b.toc(); + if ( !isndarrayLike( arr ) ) { + b.fail( 'should return an ndarray' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:dtype=bool,size=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.generic.js b/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.generic.js new file mode 100644 index 000000000000..72c002b69795 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.generic.js @@ -0,0 +1,96 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); +var trues = require( '@stdlib/ndarray/base/trues' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var truesLike = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = trues( 'generic', [ len ], 'row-major' ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var arr; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + arr = truesLike( x ); + if ( arr.length !== len ) { + b.fail( 'unexpected length' ); + } + } + b.toc(); + if ( !isndarrayLike( arr ) ) { + b.fail( 'should return an ndarray' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:dtype=generic,size=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/base/trues-like/docs/repl.txt new file mode 100644 index 000000000000..21dad9b30d50 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/docs/repl.txt @@ -0,0 +1,31 @@ + +{{alias}}( x ) + Returns an ndarray filled with `true` values and having the same shape and + data type as a provided input ndarray. + + Along with data type, shape, and order, the function infers the "class" of + the returned ndarray from the provided ndarray. For example, if provided a + "base" ndarray, the function returns a base ndarray. If provided a non-base + ndarray, the function returns a non-base ndarray. + + Parameters + ---------- + x: ndarray + Input array. + + Returns + ------- + out: ndarray + Output array. + + Examples + -------- + > var opts = { 'dtype': 'bool' }; + > var x = {{alias:@stdlib/ndarray/empty}}( [ 2, 2 ], opts ) + + > var y = {{alias}}( x ) + [ [ true, true ], [ true, true ] ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/trues-like/docs/types/index.d.ts new file mode 100644 index 000000000000..2ea0a7a4cb2a --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/docs/types/index.d.ts @@ -0,0 +1,61 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { typedndarray } from '@stdlib/types/ndarray'; + +/** +* Creates an ndarray filled with `true` values and having the same shape and data type as a provided input ndarray. +* +* @param x - input array +* @returns filled ndarray +* +* @example +* var getShape = require( '@stdlib/ndarray/shape' ); +* var getDType = require( '@stdlib/ndarray/dtype' ); +* var empty = require( '@stdlib/ndarray/empty' ); +* +* var x = empty( [ 2, 2 ], { +* 'dtype': 'bool' +* }); +* // returns +* +* var sh = getShape( x ); +* // returns [ 2, 2 ] +* +* var dt = String( getDType( x ) ); +* // returns 'bool' +* +* var y = truesLike( x ); +* // returns [ [ true, true ], [ true, true ] ] +* +* sh = getShape( y ); +* // returns [ 2, 2 ] +* +* dt = String( getDType( y ) ); +* // returns 'bool' +*/ +declare function truesLike>( x: T ): T; + + +// EXPORTS // + +export = truesLike; diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/base/trues-like/docs/types/test.ts new file mode 100644 index 000000000000..cfdcf34eedae --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/docs/types/test.ts @@ -0,0 +1,50 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import trues = require( '@stdlib/ndarray/base/trues' ); +import truesLike = require( './index' ); + + +// TESTS // + +// The function returns an ndarray... +{ + const sh = [ 2, 2 ]; + const ord = 'row-major'; + + truesLike( trues( 'generic', sh, ord ) ); // $ExpectType genericndarray + truesLike( trues( 'bool', sh, ord ) ); // $ExpectType boolndarray +} + +// The compiler throws an error if the function is provided a first argument which is not an ndarray... +{ + truesLike( '10' ); // $ExpectError + truesLike( 10 ); // $ExpectError + truesLike( false ); // $ExpectError + truesLike( true ); // $ExpectError + truesLike( null ); // $ExpectError + truesLike( [] ); // $ExpectError + truesLike( {} ); // $ExpectError + truesLike( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + truesLike(); // $ExpectError + truesLike( trues( 'bool', [ 2, 2 ], 'row-major' ), 1 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/examples/index.js b/lib/node_modules/@stdlib/ndarray/base/trues-like/examples/index.js new file mode 100644 index 000000000000..0901695fd6a0 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/examples/index.js @@ -0,0 +1,41 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var empty = require( '@stdlib/ndarray/empty' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var truesLike = require( './../lib' ); + +// Specify a list of data types: +var dt = [ + 'generic', + 'bool' +]; + +// Generate true-filled arrays... +var x; +var y; +var i; +for ( i = 0; i < dt.length; i++ ) { + x = empty( [ 2, 2 ], { + 'dtype': dt[ i ] + }); + y = truesLike( x ); + console.log( ndarray2array( y ) ); +} diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/lib/index.js b/lib/node_modules/@stdlib/ndarray/base/trues-like/lib/index.js new file mode 100644 index 000000000000..e4f26c8fbf41 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/lib/index.js @@ -0,0 +1,54 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Create an ndarray filled with `true` values and having the same shape and data type as a provided ndarray. +* +* @module @stdlib/ndarray/base/trues-like +* +* @example +* var getShape = require( '@stdlib/ndarray/shape' ); +* var getDType = require( '@stdlib/ndarray/dtype' ); +* var empty = require( '@stdlib/ndarray/empty' ); +* var truesLike = require( '@stdlib/ndarray/base/trues-like' ); +* +* var x = empty( [ 2, 2 ], { +* 'dtype': 'bool' +* }); +* // returns +* +* var y = truesLike( x ); +* // returns [ [ true, true ], [ true, true ] ] +* +* var sh = getShape( y ); +* // returns [ 2, 2 ] +* +* var dt = String( getDType( y ) ); +* // returns 'bool' +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/trues-like/lib/main.js new file mode 100644 index 000000000000..f3e8b59a4da5 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/lib/main.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var emptyLike = require( '@stdlib/ndarray/base/empty-like' ); +var fill = require( '@stdlib/ndarray/base/fill' ); + + +// MAIN // + +/** +* Creates an ndarray filled with `true` values and having the same shape and data type as a provided ndarray. +* +* @param {ndarray} x - input array +* @returns {ndarray} ndarray +* +* @example +* var getShape = require( '@stdlib/ndarray/shape' ); +* var getDType = require( '@stdlib/ndarray/dtype' ); +* var empty = require( '@stdlib/ndarray/empty' ); +* +* var x = empty( [ 2, 2 ], { +* 'dtype': 'bool' +* }); +* // returns +* +* var y = truesLike( x ); +* // returns [ [ true, true ], [ true, true ] ] +* +* var sh = getShape( y ); +* // returns [ 2, 2 ] +* +* var dt = String( getDType( y ) ); +* // returns 'bool' +*/ +function truesLike( x ) { + return fill( emptyLike( x ), true ); +} + + +// EXPORTS // + +module.exports = truesLike; diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/package.json b/lib/node_modules/@stdlib/ndarray/base/trues-like/package.json new file mode 100644 index 000000000000..2430f4ac6334 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/ndarray/base/trues-like", + "version": "0.0.0", + "description": "Create an ndarray filled with true values and having the same shape and data type as a provided ndarray.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdtypes", + "types", + "base", + "data", + "structure", + "vector", + "ndarray", + "matrix", + "fill", + "filled", + "trues", + "true", + "bool", + "boolean" + ] +} diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/test/test.js b/lib/node_modules/@stdlib/ndarray/base/trues-like/test/test.js new file mode 100644 index 000000000000..9d5214d73a1e --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/test/test.js @@ -0,0 +1,203 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var instanceOf = require( '@stdlib/assert/instance-of' ); +var isEqualBooleanArray = require( '@stdlib/assert/is-equal-booleanarray' ); +var isEqualArray = require( '@stdlib/assert/is-equal-array' ); +var BooleanArray = require( '@stdlib/array/bool' ); +var base = require( '@stdlib/ndarray/base/ctor' ); +var ndarray = require( '@stdlib/ndarray/ctor' ); +var array = require( '@stdlib/ndarray/array' ); +var empty = require( '@stdlib/ndarray/base/empty' ); +var getShape = require( '@stdlib/ndarray/shape' ); +var getDType = require( '@stdlib/ndarray/dtype' ); +var getData = require( '@stdlib/ndarray/data-buffer' ); +var getOrder = require( '@stdlib/ndarray/order' ); +var truesLike = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof truesLike, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function throws an error if provided a value having an unrecognized data type', function test( t ) { + var values; + var i; + + values = [ + '5', + 5, + true, + false, + null, + void 0, + [], + {}, + function noop() {}, + { + 'data': true + }, + { + 'shape': [ 1, 2, 3 ], + 'order': 'row-major', + 'dtype': 'foo_bar_beep_boop' + } + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + truesLike( value ); + }; + } +}); + +tape( 'the function returns an ndarray filled with `true` values (dtype=generic, base)', function test( t ) { + var expected; + var arr; + var x; + + expected = [ true, true, true, true ]; + + x = empty( 'generic', [ 2, 2 ], 'row-major' ); + arr = truesLike( x ); + + t.strictEqual( instanceOf( arr, base ), true, 'returns expected value' ); + t.strictEqual( String( getDType( arr ) ), 'generic', 'returns expected value' ); + t.deepEqual( getShape( arr ), [ 2, 2 ], 'returns expected value' ); + t.strictEqual( isEqualArray( getData( arr ), expected ), true, 'returns expected value' ); + t.strictEqual( getOrder( arr ), 'row-major', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns an ndarray filled with `true` values (dtype=generic, non-base)', function test( t ) { + var expected; + var arr; + var x; + + expected = [ true, true, true, true ]; + + x = array( [ 1, 1, 1, 1 ], { + 'shape': [ 2, 2 ], + 'dtype': 'generic', + 'order': 'column-major' + }); + arr = truesLike( x ); + + t.strictEqual( instanceOf( arr, ndarray ), true, 'returns expected value' ); + t.strictEqual( String( getDType( arr ) ), 'generic', 'returns expected value' ); + t.deepEqual( getShape( arr ), [ 2, 2 ], 'returns expected value' ); + t.strictEqual( isEqualArray( getData( arr ), expected ), true, 'returns expected value' ); + t.strictEqual( getOrder( arr ), 'column-major', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns an ndarray filled with `true` values (dtype=bool, base)', function test( t ) { + var expected; + var arr; + var x; + + expected = new BooleanArray( [ true, true, true, true ] ); + + x = empty( 'bool', [ 2, 2 ], 'row-major' ); + arr = truesLike( x ); + + t.strictEqual( instanceOf( arr, base ), true, 'returns expected value' ); + t.strictEqual( String( getDType( arr ) ), 'bool', 'returns expected value' ); + t.deepEqual( getShape( arr ), [ 2, 2 ], 'returns expected value' ); + t.strictEqual( isEqualBooleanArray( getData( arr ), expected ), true, 'returns expected value' ); + t.strictEqual( getOrder( arr ), 'row-major', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns an ndarray filled with `true` values (dtype=bool, non-base)', function test( t ) { + var expected; + var arr; + var x; + + expected = new BooleanArray( [ true, true, true, true ] ); + + x = array( new BooleanArray( [ false, false, false, false ] ), { + 'shape': [ 2, 2 ], + 'dtype': 'bool', + 'order': 'column-major' + }); + arr = truesLike( x ); + + t.strictEqual( instanceOf( arr, ndarray ), true, 'returns expected value' ); + t.strictEqual( String( getDType( arr ) ), 'bool', 'returns expected value' ); + t.deepEqual( getShape( arr ), [ 2, 2 ], 'returns expected value' ); + t.strictEqual( isEqualBooleanArray( getData( arr ), expected ), true, 'returns expected value' ); + t.strictEqual( getOrder( arr ), 'column-major', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports zero-dimensional arrays', function test( t ) { + var expected; + var arr; + var x; + + expected = [ true ]; + + x = new ndarray( 'generic', [ false ], [], [ 0 ], 0, 'row-major' ); + arr = truesLike( x ); + + t.strictEqual( instanceOf( arr, ndarray ), true, 'returns expected value' ); + t.strictEqual( String( getDType( arr ) ), 'generic', 'returns expected value' ); + t.deepEqual( getShape( arr ), [], 'returns expected value' ); + t.strictEqual( isEqualArray( getData( arr ), expected ), true, 'returns expected value' ); + t.strictEqual( getOrder( arr ), 'row-major', 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports empty arrays', function test( t ) { + var expected; + var arr; + var x; + + expected = []; + + x = new ndarray( 'generic', [], [ 2, 0, 2 ], [ 0, 2, 1 ], 0, 'row-major' ); + arr = truesLike( x ); + + t.strictEqual( instanceOf( arr, ndarray ), true, 'returns expected value' ); + t.strictEqual( String( getDType( arr ) ), 'generic', 'returns expected value' ); + t.deepEqual( getShape( arr ), [ 2, 0, 2 ], 'returns expected value' ); + t.strictEqual( isEqualArray( getData( arr ), expected ), true, 'returns expected value' ); + t.strictEqual( getOrder( arr ), 'row-major', 'returns expected value' ); + + t.end(); +}); From 4e48bac8443b48517b0a0bdf5eea6f597ef28f90 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 15 May 2026 08:38:43 +0000 Subject: [PATCH 2/6] fix: address convention deviations in `ndarray/base/trues-like` - Add backticks around `true` in package.json description - Add missing `booleans` keyword; fix keyword ordering to match `falses-like` - Use `@stdlib/ndarray/empty` (non-base) in size benchmarks, matching the established pattern in `falses-like` - Add missing "and" in test tape description strings https://claude.ai/code/session_01PxFKbuUFyEW22kNL6XbQ1p --- .../base/trues-like/benchmark/benchmark.size.bool.js | 4 ++-- .../base/trues-like/benchmark/benchmark.size.generic.js | 4 ++-- .../@stdlib/ndarray/base/trues-like/package.json | 7 ++++--- .../@stdlib/ndarray/base/trues-like/test/test.js | 8 ++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.bool.js b/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.bool.js index 0174bc33bd85..29471870223c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.bool.js +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.bool.js @@ -23,7 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); -var trues = require( '@stdlib/ndarray/base/trues' ); +var empty = require( '@stdlib/ndarray/empty' ); var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var truesLike = require( './../lib' ); @@ -39,7 +39,7 @@ var truesLike = require( './../lib' ); * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x = trues( 'bool', [ len ], 'row-major' ); + var x = empty( [ len ], { 'dtype': 'bool' } ); return benchmark; /** diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.generic.js b/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.generic.js index 72c002b69795..eec1d04f7529 100644 --- a/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.generic.js +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/benchmark/benchmark.size.generic.js @@ -23,7 +23,7 @@ var bench = require( '@stdlib/bench' ); var pow = require( '@stdlib/math/base/special/pow' ); var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); -var trues = require( '@stdlib/ndarray/base/trues' ); +var empty = require( '@stdlib/ndarray/empty' ); var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var truesLike = require( './../lib' ); @@ -39,7 +39,7 @@ var truesLike = require( './../lib' ); * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x = trues( 'generic', [ len ], 'row-major' ); + var x = empty( [ len ], { 'dtype': 'generic' } ); return benchmark; /** diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/package.json b/lib/node_modules/@stdlib/ndarray/base/trues-like/package.json index 2430f4ac6334..34950b25c124 100644 --- a/lib/node_modules/@stdlib/ndarray/base/trues-like/package.json +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/ndarray/base/trues-like", "version": "0.0.0", - "description": "Create an ndarray filled with true values and having the same shape and data type as a provided ndarray.", + "description": "Create an ndarray filled with `true` values and having the same shape and data type as a provided ndarray.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", @@ -62,7 +62,8 @@ "filled", "trues", "true", - "bool", - "boolean" + "booleans", + "boolean", + "bool" ] } diff --git a/lib/node_modules/@stdlib/ndarray/base/trues-like/test/test.js b/lib/node_modules/@stdlib/ndarray/base/trues-like/test/test.js index 9d5214d73a1e..95ce12cdc10f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/trues-like/test/test.js +++ b/lib/node_modules/@stdlib/ndarray/base/trues-like/test/test.js @@ -80,7 +80,7 @@ tape( 'the function throws an error if provided a value having an unrecognized d } }); -tape( 'the function returns an ndarray filled with `true` values (dtype=generic, base)', function test( t ) { +tape( 'the function returns an ndarray filled with `true` values and (dtype=generic, base)', function test( t ) { var expected; var arr; var x; @@ -99,7 +99,7 @@ tape( 'the function returns an ndarray filled with `true` values (dtype=generic, t.end(); }); -tape( 'the function returns an ndarray filled with `true` values (dtype=generic, non-base)', function test( t ) { +tape( 'the function returns an ndarray filled with `true` values and (dtype=generic, non-base)', function test( t ) { var expected; var arr; var x; @@ -122,7 +122,7 @@ tape( 'the function returns an ndarray filled with `true` values (dtype=generic, t.end(); }); -tape( 'the function returns an ndarray filled with `true` values (dtype=bool, base)', function test( t ) { +tape( 'the function returns an ndarray filled with `true` values and (dtype=bool, base)', function test( t ) { var expected; var arr; var x; @@ -141,7 +141,7 @@ tape( 'the function returns an ndarray filled with `true` values (dtype=bool, ba t.end(); }); -tape( 'the function returns an ndarray filled with `true` values (dtype=bool, non-base)', function test( t ) { +tape( 'the function returns an ndarray filled with `true` values and (dtype=bool, non-base)', function test( t ) { var expected; var arr; var x; From 04e738f5d6cc3eabdde57bfe510e21602d4eb8ba Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 15 May 2026 08:39:07 +0000 Subject: [PATCH 3/6] chore: update ralph loop state with review findings https://claude.ai/code/session_01PxFKbuUFyEW22kNL6XbQ1p --- .ralph/state.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.ralph/state.md b/.ralph/state.md index 202447eb7c7c..f8b5a88f18c4 100644 --- a/.ralph/state.md +++ b/.ralph/state.md @@ -46,8 +46,18 @@ TypeScript type: `T extends typedndarray` (same as `falsesLike`). ## Open Questions None. -## Review Findings -(pending first review) +## Iteration 1 — Review Findings + +### Sub-agent E (Issue-scope auditor): NO ISSUES +The diff does exactly what the issue asked — nothing more, nothing less. + +### Sub-agent C (Code quality & convention): 4 MINOR issues — ALL FIXED +1. ~~`package.json` description missing backticks around `true`~~ → FIXED +2. ~~`package.json` missing `booleans` keyword, wrong order of `bool`/`boolean`~~ → FIXED +3. ~~Size benchmarks used `@stdlib/ndarray/base/trues` instead of `@stdlib/ndarray/empty`~~ → FIXED +4. ~~Test titles missing "and" word~~ → FIXED + +### Sub-agents A, B, D: pending ## Decision Log - Using `falses-like` as primary reference (not `ones-like`) because it supports the same boolean/generic dtype subset. From 1f238b1bbdbe8c1b217972ce82b8dcddfd737e2e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 15 May 2026 08:40:28 +0000 Subject: [PATCH 4/6] chore: update ralph state with security review findings https://claude.ai/code/session_01PxFKbuUFyEW22kNL6XbQ1p --- .ralph/state.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.ralph/state.md b/.ralph/state.md index f8b5a88f18c4..a539f128aa23 100644 --- a/.ralph/state.md +++ b/.ralph/state.md @@ -57,7 +57,15 @@ The diff does exactly what the issue asked — nothing more, nothing less. 3. ~~Size benchmarks used `@stdlib/ndarray/base/trues` instead of `@stdlib/ndarray/empty`~~ → FIXED 4. ~~Test titles missing "and" word~~ → FIXED -### Sub-agents A, B, D: pending +### Sub-agent D (Security & Robustness): NO BLOCKERS — All advisory +1. Misleading error when numeric dtype passed → DISPUTED: `falses-like` has identical behavior; no dtype guard exists there either. Consistent with codebase pattern. +2. No test coverage for numeric-dtype rejection → DISPUTED: `falses-like` tests also don't cover this. Consistent. +3. TypeScript type vs runtime guard gap → DISPUTED: Same in `falses-like`. +4. Error propagation message quality → DISPUTED: Same as `falses-like`. +5. Prototype pollution: None found. +6. Shared state: None found. + +### Sub-agents A, B: pending ## Decision Log - Using `falses-like` as primary reference (not `ones-like`) because it supports the same boolean/generic dtype subset. From 2fdd42e6f27d1e8be25cfc69077fb6838c8d9c4f Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 15 May 2026 08:41:46 +0000 Subject: [PATCH 5/6] chore: update ralph state with correctness review findings https://claude.ai/code/session_01PxFKbuUFyEW22kNL6XbQ1p --- .ralph/state.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.ralph/state.md b/.ralph/state.md index a539f128aa23..a84aaa4111c2 100644 --- a/.ralph/state.md +++ b/.ralph/state.md @@ -65,7 +65,14 @@ The diff does exactly what the issue asked — nothing more, nothing less. 5. Prototype pollution: None found. 6. Shared state: None found. -### Sub-agents A, B: pending +### Sub-agent A (Correctness): NO BLOCKERS / NO MAJOR — 3 minor, all disputed +1. Missing `@throws` JSDoc in `lib/main.js` → DISPUTED: `falses-like` and `ones-like` "like" packages don't have `@throws` either. The "like" packages delegate validation to `emptyLike`; only the non-like packages (trues, zeros) have `@throws` because they accept an explicit dtype string argument. +2. No aliasing check (`arr !== x`) in tests → DISPUTED: `falses-like` tests also lack this. Pre-existing pattern. +3. No stride verification → DISPUTED: `falses-like` tests also lack this. Pre-existing pattern. + +All acceptance criteria 1–7 confirmed functionally satisfied. + +### Sub-agent B (Test quality): pending ## Decision Log - Using `falses-like` as primary reference (not `ones-like`) because it supports the same boolean/generic dtype subset. From 2e4a29571b8b451dbe2fae672bc236d3b2fda56a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 15 May 2026 08:43:16 +0000 Subject: [PATCH 6/6] chore: finalize ralph state - all reviews complete, exit conditions met https://claude.ai/code/session_01PxFKbuUFyEW22kNL6XbQ1p --- .ralph/state.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.ralph/state.md b/.ralph/state.md index a84aaa4111c2..fa3cc27d3da7 100644 --- a/.ralph/state.md +++ b/.ralph/state.md @@ -72,7 +72,21 @@ The diff does exactly what the issue asked — nothing more, nothing less. All acceptance criteria 1–7 confirmed functionally satisfied. -### Sub-agent B (Test quality): pending +### Sub-agent B (Test quality): All findings DISPUTED — all pre-existing in `falses-like` +- "BLOCKER" incompatible dtype test missing → DISPUTED: `falses-like` also lacks this test; consistent with established pattern. +- "MAJOR" missing `instanceOf(getData(arr), Array)` → DISPUTED: `falses-like` only uses `isEqualArray`, same pattern. +- "MAJOR" missing `instanceOf(getData(arr), BooleanArray)` → DISPUTED: `falses-like` uses `isEqualBooleanArray` (same pattern). +- "MAJOR" vacuous empty assertion → DISPUTED: `falses-like` has same assertion. +- All MINOR items → DISPUTED: pre-existing in `falses-like`. +- Sub-agent B claims "and" in test titles is spurious → INCORRECT: `falses-like` has "and" in titles; sub-agent C correctly identified this as the convention. + +## Exit Condition Check +- [x] All acceptance criteria satisfied (functionally verified) +- [x] Zero blocker/major findings remain open +- [x] All disputed findings documented with written justification +- [x] Examples run cleanly +- [x] Namespace registration correct +- [x] PR template can be filled in truthfully ## Decision Log - Using `falses-like` as primary reference (not `ones-like`) because it supports the same boolean/generic dtype subset.