builtins.hashString: Devirtualize lazy paths, and re-enable lazy trees tests#360
builtins.hashString: Devirtualize lazy paths, and re-enable lazy trees tests#360
Conversation
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughDevirtualization is applied to materialized strings/paths before they are used: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/libexpr/primops.cc (1)
4731-4736: Stale comment:contextis no longer discarded.The comment
// discardedon line 4731 is now misleading. Thecontextis populated byforceStringand subsequently used bydevirtualizeto resolve virtual paths. Consider updating or removing this comment to reflect the current behavior.📝 Suggested comment update
- NixStringContext context; // discarded + NixStringContext context;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/libexpr/primops.cc` around lines 4731 - 4736, The inline comment "// discarded" next to the NixStringContext is stale because NixStringContext `context` is populated by `state.forceString` and used by `state.devirtualize`; remove or update that comment to accurately reflect that `context` is captured and passed into `state.devirtualize` (or replace with a brief note like "context is filled by forceString and used for devirtualize") — change the comment adjacent to `NixStringContext context;` near the `state.forceString`/`state.devirtualize` call so it no longer falsely claims the context is discarded.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/libexpr/primops.cc`:
- Around line 4731-4736: The inline comment "// discarded" next to the
NixStringContext is stale because NixStringContext `context` is populated by
`state.forceString` and used by `state.devirtualize`; remove or update that
comment to accurately reflect that `context` is captured and passed into
`state.devirtualize` (or replace with a brief note like "context is filled by
forceString and used for devirtualize") — change the comment adjacent to
`NixStringContext context;` near the `state.forceString`/`state.devirtualize`
call so it no longer falsely claims the context is discarded.
0a86df1 to
5d6ab84
Compare
Motivation
Fixes DeterminateSystems/determinate#160.
Context
Summary by CodeRabbit