Skip to content

perf(supervisor-network): avoid reparsing native policy input - #2654

Open
shiju-nv wants to merge 1 commit into
NVIDIA:mainfrom
shiju-nv:perf/native-policy-direct-input
Open

perf(supervisor-network): avoid reparsing native policy input#2654
shiju-nv wants to merge 1 commit into
NVIDIA:mainfrom
shiju-nv:perf/native-policy-direct-input

Conversation

@shiju-nv

@shiju-nv shiju-nv commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

OpenShell currently builds a serde_json::Value, serializes it to JSON text, and asks Regorus to parse that text into its own value representation. Convert the existing serde_json::Value directly into regorus::Value, then pass it to Engine::set_input. This removes the intermediate string and JSON text parse while continuing to return conversion errors before policy evaluation.

Changes

  • Rename the constructed native-policy input from input_json to input.
  • Convert the existing serde_json::Value directly into regorus::Value without serializing and reparsing JSON text.
  • Return conversion errors before policy evaluation instead of allowing Regorus's infallible From<serde_json::Value> conversion to map failures to Undefined.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Convert the existing Serde JSON policy input directly into Regorus.

Preserve conversion errors while avoiding JSON string allocation and parsing.

Signed-off-by: Shiju <shiju@nvidia.com>
@mrunalp

mrunalp commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Do we want to audit and address similar call sites in opa.rs as well?

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.

2 participants