Skip to content

feat: Sync from 0.2 updates#194

Merged
jake-arkinstall merged 3 commits into
0.3-seriesfrom
feat/sync-0.2-updates-to-0.3
Jul 16, 2026
Merged

feat: Sync from 0.2 updates#194
jake-arkinstall merged 3 commits into
0.3-seriesfrom
feat/sync-0.2-updates-to-0.3

Conversation

@jake-arkinstall

Copy link
Copy Markdown
Collaborator
  • Adds zero-length array support to argreader
  • Adds envreader
  • Allows per-process environment variable setting in multiprocessing environments

Copilot AI review requested due to automatic review settings July 16, 2026 11:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR syncs updates from the 0.2 line by expanding the bundled utilities (adding an EnvReader utility alongside ArgReader), improving ArgReader behavior for zero-length arrays, and enabling per-process environment variable overrides for multiprocessing runs in selene-sim.

Changes:

  • Add EnvReader utility (Rust cdylib + Python plugin) with tests and example LLVM IR.
  • Add support paths for zero-length arrays in ArgReader (including trace post-processing) plus new tests/snapshots.
  • Add per-process environment variable remapping for SeleneProcess instances spawned by run_shots.

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
selene-sim/python/selene_sim/process.py Adds process_list_index and remaps prefixed env vars for per-process configuration.
selene-sim/python/selene_sim/instance.py Passes process index into SeleneProcess when spawning multiple processes.
selene-sim/python/selene_sim/backends/bundled_utilities.py Exposes bundled utility plugins via combined __all__.
selene-ext/utilities/envreader/rust/lib.rs Implements EnvReader Rust utility functions and logging.
selene-ext/utilities/envreader/python/tests/test_envreader.py Adds Python tests for EnvReader and per-process env behavior.
selene-ext/utilities/envreader/python/tests/resources/envreader_example.ll Adds LLVM IR fixture calling EnvReader functions.
selene-ext/utilities/envreader/python/selene_envreader_plugin/plugin.py Adds Python Utility plugin wrapper for EnvReader library loading/linking.
selene-ext/utilities/envreader/python/selene_envreader_plugin/init.py Exports EnvReaderPlugin.
selene-ext/utilities/envreader/Cargo.toml Adds Cargo package definition for EnvReader utility.
selene-ext/utilities/envreader/Cargo.lock Adds lockfile for EnvReader utility dependencies.
selene-ext/utilities/envreader/build.rs Adds build script to link against the Base QIS interface runtime and set rpath.
selene-ext/utilities/argreader/rust/lib.rs Adds handling allowing bool-array-typed inputs to satisfy numeric array getters (enabling empty arrays).
selene-ext/utilities/argreader/python/tests/test_argreader.py Updates imports, adds trace-pass snapshotting, and adds zero-length array test.
selene-ext/utilities/argreader/python/tests/snapshots/test_argreader/test_arg_reader_zero_length_arrays/interface1/trace.json Adds snapshot for zero-length array trace output (interface1).
selene-ext/utilities/argreader/python/tests/snapshots/test_argreader/test_arg_reader_zero_length_arrays/interface1/pass.json Adds snapshot for zero-length array post-processed trace (interface1).
selene-ext/utilities/argreader/python/tests/snapshots/test_argreader/test_arg_reader_zero_length_arrays/interface0/trace.json Adds snapshot for zero-length array trace output (interface0).
selene-ext/utilities/argreader/python/tests/snapshots/test_argreader/test_arg_reader_zero_length_arrays/interface0/pass.json Adds snapshot for zero-length array post-processed trace (interface0).
selene-ext/utilities/argreader/python/tests/snapshots/test_argreader/test_arg_reader_trace/interface1/pass.json Adds snapshot for trace-pass output (interface1).
selene-ext/utilities/argreader/python/tests/snapshots/test_argreader/test_arg_reader_trace/interface0/pass.json Adds snapshot for trace-pass output (interface0).
selene-ext/utilities/argreader/python/tests/resources/argreader_zero_length_arrays.ll Adds LLVM IR fixture calling ArgReader array getters with len=0.
selene-ext/utilities/argreader/python/tests/resources/argreader_example.ll Adds an extra external declaration to the example fixture.
selene-ext/utilities/argreader/python/selene_argreader_plugin/trace_pass.py Adds a trace pass to convert ArgReader opaque YAML payloads into structured key/value events.
selene-ext/utilities/argreader/python/selene_argreader_plugin/provider.py Allows empty lists in provided runtime arguments (enables zero-length arrays).
selene-ext/utilities/argreader/python/selene_argreader_plugin/init.py Exports argreader_trace_pass from the package.
pyproject.toml Bumps selene-core requirement and includes the EnvReader Python package; adjusts uv cache keys.
.github/workflows/build_wheels.yml Removes id-token: write permission from the workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread selene-sim/python/selene_sim/process.py Outdated
Comment on lines +65 to +72
# Per-process environment variables can be set with a prefix,
# e.g. setting "SELENE_PROCESS_3_FOO=5" will set the environment
# variable "FOO" to "5" for the process with index 3 (zero-indexed).
prefix = f"SELENE_PROCESS_{self.process_list_index}_"
for key, value in list(env.items()):
if key.startswith(prefix):
env[key[len(prefix) :]] = value
del env[key]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Fix the code for this review comment.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review comment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the latest commit. The updated logic now collects the promoted variables for the current process index first, then filters out all SELENE_PROCESS_* variables from the environment, and finally applies the promoted variables — ensuring no other process's scoped variables remain visible.

@jake-arkinstall
jake-arkinstall merged commit b3c1093 into 0.3-series Jul 16, 2026
10 checks passed
@jake-arkinstall
jake-arkinstall deleted the feat/sync-0.2-updates-to-0.3 branch July 16, 2026 11:51
jake-arkinstall pushed a commit that referenced this pull request Jul 16, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.3.0-alpha.2](selene-sim-v0.3.0-alpha.1...selene-sim-v0.3.0-alpha.2)
(2026-07-16)


### Features

* Sync from 0.2 updates
([#194](#194))
([b3c1093](b3c1093))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants