Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

nvx-rs: print zero MSR values in `nvx-time-probe clock --msr` as C's `%#x` does

Open Beginner friendly
#589 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
80/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c, rust
Domain
cli

Research direction

Start in print_msrs in nvx-rs/src/guest/time_probe/clock.rs, where MSR values are printed with {:#x}, and look at alternate_hex_width_10 in the same file as a model for a helper that matches C's %#x. Done when zero MSR values print as 0 while nonzero values keep the 0x prefix, and a regression test checks both cases against the C program's output.

Written by the indexing model from the issue text.

Description

Summary

nvx-time-probe clock --msr prints each MSR's value with Rust's {:#x}, which prints zero as 0x0. The C program printed it with %#" PRIx64, whose alternate form prefixes 0x to nonzero values only, so a zero MSR prints = 0x0 (0) where C printed = 0 (0). CPU 0's HV_X64_MSR_VP_INDEX, which the probe reads, is always zero, so every clock --msr run that can read the MSRs differs from the C program's byte-exact output.

Found in the #550 review. The port has differed since its first revision, and #550 leaves the fix to this issue. #590 is the same difference in the CPUID fields.

Proposal

Add a helper for C's %#x, which prints zero without the prefix, as alternate_hex_width_10 in nvx-rs/src/guest/time_probe/clock.rs already does for %#010x, and print the MSR values with it. #590 can use the same helper.

Tasks

  • Print zero MSR values as 0 in print_msrs, keeping 0x before nonzero values.
  • Add a regression that formats zero and nonzero MSR values, with the C program's output as the expected result.
Dominant language
Python
Stars
408
Forks
28
Avg merge
13h 46m
Merged PRs (30d)
275

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/nvx

All issues in microsoft/nvx

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.