Repository: microsoft/qsharp
Pull request #1517 (2024-05-13 23:02:20)

Fix integer output recording name

github-actions[bot]: ## Benchmark for 3ac4488
  <details>
    <summary>Click to view benchmark</summary>

| Test | Base         | PR               | % |
|------|--------------|------------------|---|
| Array append evaluation | 342.2±4.12µs | 340.9±4.63µs | -0.38% |
| Array literal evaluation | 185.8±4.53µs | 187.0±2.84µs | +0.65% |
| Array update evaluation | 422.9±5.32µs | 423.4±8.03µs | +0.12% |
| Core + Standard library compilation | 16.3±0.30ms | 16.3±0.36ms | 0.00% |
| Deutsch-Jozsa evaluation | 5.1±0.10ms | 5.1±0.13ms | 0.00% |
| Large file parity evaluation | 33.2±0.54ms | 33.4±0.77ms | +0.60% |
| Large input file compilation | 11.2±0.19ms | **11.0±0.16ms** | **-1.79%** |
| Large input file compilation (interpreter) | 42.9±0.99ms | 42.8±0.96ms | -0.23% |
| Large nested iteration | 33.3±0.53ms | 33.4±0.79ms | +0.30% |
| Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1532.0±26.79µs | 1532.1±36.09µs | +0.01% |
| Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.5±0.14ms | 7.5±0.14ms | 0.00% |
| Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1392.4±36.69µs | 1399.4±41.07µs | +0.50% |
| Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 26.9±0.62ms | 26.9±0.85ms | 0.00% |
| Teleport evaluation | 90.9±4.04µs | 93.1±5.30µs | +2.42% |

  </details>
  
github-actions[bot]: ## Benchmark for 8e05b1a
  <details>
    <summary>Click to view benchmark</summary>

| Test | Base         | PR               | % |
|------|--------------|------------------|---|
| Array append evaluation | **345.2±2.42µs** | 354.7±3.62µs | **+2.75%** |
| Array literal evaluation | 189.6±1.27µs | **178.2±3.43µs** | **-6.01%** |
| Array update evaluation | **431.6±4.58µs** | 445.4±4.12µs | **+3.20%** |
| Core + Standard library compilation | **18.9±0.69ms** | 19.6±0.80ms | **+3.70%** |
| Deutsch-Jozsa evaluation | **5.0±0.04ms** | 5.1±0.18ms | **+2.00%** |
| Large file parity evaluation | 33.8±0.35ms | 33.9±0.57ms | +0.30% |
| Large input file compilation | **12.3±0.40ms** | 13.1±0.53ms | **+6.50%** |
| Large input file compilation (interpreter) | 48.8±1.21ms | 49.0±1.27ms | +0.41% |
| Large nested iteration | **33.9±0.18ms** | 35.3±0.34ms | **+4.13%** |
| Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1590.6±97.84µs | 1585.6±112.89µs | -0.31% |
| Perform Runtime Capabilities Analysis (RCA) on large file sample | 8.0±0.14ms | 8.1±0.19ms | +1.25% |
| Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1455.9±110.17µs | 1446.2±113.68µs | -0.67% |
| Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | **27.9±0.19ms** | 28.2±0.43ms | **+1.08%** |
| Teleport evaluation | 88.8±9.11µs | 88.1±3.75µs | -0.79% |

  </details>
  
github-actions[bot]: ## Benchmark for 214653b
  <details>
    <summary>Click to view benchmark</summary>

| Test | Base         | PR               | % |
|------|--------------|------------------|---|
| Array append evaluation | **344.2±18.15µs** | 351.9±2.01µs | **+2.24%** |
| Array literal evaluation | **170.7±1.83µs** | 192.4±0.84µs | **+12.71%** |
| Array update evaluation | **426.3±1.45µs** | 441.1±2.24µs | **+3.47%** |
| Core + Standard library compilation | 18.3±1.13ms | 18.1±0.90ms | -1.09% |
| Deutsch-Jozsa evaluation | 5.1±0.04ms | 5.1±0.10ms | 0.00% |
| Large file parity evaluation | 33.9±0.12ms | 33.8±0.30ms | -0.29% |
| Large input file compilation | 12.2±0.79ms | 12.2±0.71ms | 0.00% |
| Large input file compilation (interpreter) | 48.2±1.67ms | 48.6±1.95ms | +0.83% |
| Large nested iteration | **33.3±0.17ms** | 34.4±0.31ms | **+3.30%** |
| Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1574.4±81.51µs | 1585.0±85.22µs | +0.67% |
| Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.9±0.16ms | 8.0±0.18ms | +1.27% |
| Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1449.9±155.73µs | 1464.0±166.48µs | +0.97% |
| Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 27.9±0.44ms | 27.8±0.36ms | -0.36% |
| Teleport evaluation | 88.9±3.84µs | 89.8±10.32µs | +1.01% |

  </details>
  

Patch:
diff --git a/compiler/qsc_rir/src/builder.rs b/compiler/qsc_rir/src/builder.rs
index aa67cc07..50ae4d09 100644
--- a/compiler/qsc_rir/src/builder.rs
+++ b/compiler/qsc_rir/src/builder.rs
@@ -121,7 +121,7 @@ pub fn result_record_decl() -> Callable {
 #[must_use]
 pub fn int_record_decl() -> Callable {
     Callable {
-        name: "__quantum__rt__integer_record_output".to_string(),
+        name: "__quantum__rt__int_record_output".to_string(),
         input_type: vec![Ty::Integer, Ty::Pointer],
         output_type: None,
         body: None,


Test patch:
diff --git a/compiler/qsc/src/codegen/tests.rs b/compiler/qsc/src/codegen/tests.rs
index f1d021a9..40160e82 100644
--- a/compiler/qsc/src/codegen/tests.rs
+++ b/compiler/qsc/src/codegen/tests.rs
@@ -626,7 +626,7 @@ mod adaptive_ri_profile {
               br label %block_3
             block_3:
               %var_3 = phi i64 [0, %block_1], [1, %block_2]
-              call void @__quantum__rt__integer_record_output(i64 %var_3, i8* null)
+              call void @__quantum__rt__int_record_output(i64 %var_3, i8* null)
               ret void
             }
 
@@ -636,7 +636,7 @@ mod adaptive_ri_profile {
 
             declare i1 @__quantum__qis__read_result__body(%Result*)
 
-            declare void @__quantum__rt__integer_record_output(i64, i8*)
+            declare void @__quantum__rt__int_record_output(i64, i8*)
 
             attributes #0 = { "entry_point" "output_labeling_schema" "qir_profiles"="adaptive_profile" "required_num_qubits"="1" "required_num_results"="1" }
             attributes #1 = { "irreversible" }
diff --git a/compiler/qsc_partial_eval/tests/assigns.rs b/compiler/qsc_partial_eval/tests/assigns.rs
index 6821eb8d..85b03c9b 100644
--- a/compiler/qsc_partial_eval/tests/assigns.rs
+++ b/compiler/qsc_partial_eval/tests/assigns.rs
@@ -217,7 +217,7 @@ fn assigning_classical_int_updates_value_and_adds_store_instructions() {
         output_recording_callable_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -283,7 +283,7 @@ fn assigning_dynamic_int_updates_value_and_adds_store_instructions() {
         output_recording_callable_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -439,7 +439,7 @@ fn assigning_classical_int_within_dynamic_if_else_expression_adds_store_instruct
         output_recording_callable_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1170,7 +1170,7 @@ fn integer_assign_add_with_lhs_classical_integer_and_rhs_dynamic_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1250,7 +1250,7 @@ fn integer_assign_sub_with_lhs_dynamic_integer_and_rhs_classical_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1330,7 +1330,7 @@ fn integer_assign_mul_with_lhs_dynamic_integer_and_rhs_dynamic_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1421,7 +1421,7 @@ fn integer_assign_div_with_lhs_classical_integer_and_rhs_dynamic_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1501,7 +1501,7 @@ fn integer_assign_mod_with_lhs_dynamic_integer_and_rhs_classical_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1653,7 +1653,7 @@ fn integer_assign_bitwise_and_with_lhs_dynamic_integer_and_rhs_dynamic_integer()
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1744,7 +1744,7 @@ fn integer_assign_bitwise_or_with_lhs_classical_integer_and_rhs_dynamic_integer(
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1824,7 +1824,7 @@ fn integer_bitwise_xor_with_lhs_dynamic_integer_and_rhs_classical_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1904,7 +1904,7 @@ fn integer_assign_bitwise_left_shift_with_lhs_dynamic_integer_and_rhs_dynamic_in
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1995,7 +1995,7 @@ fn integer_assign_bitwise_right_shift_with_lhs_classical_integer_and_rhs_dynamic
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
diff --git a/compiler/qsc_partial_eval/tests/bindings.rs b/compiler/qsc_partial_eval/tests/bindings.rs
index ccfa7a76..568dd045 100644
--- a/compiler/qsc_partial_eval/tests/bindings.rs
+++ b/compiler/qsc_partial_eval/tests/bindings.rs
@@ -294,7 +294,7 @@ fn immutable_int_binding_does_not_generate_store_instruction() {
         output_recording_callable_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -368,7 +368,7 @@ fn mutable_int_binding_does_generate_store_instruction() {
         output_recording_callable_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
diff --git a/compiler/qsc_partial_eval/tests/intrinsics.rs b/compiler/qsc_partial_eval/tests/intrinsics.rs
index b1d2bcb7..b60cbcdb 100644
--- a/compiler/qsc_partial_eval/tests/intrinsics.rs
+++ b/compiler/qsc_partial_eval/tests/intrinsics.rs
@@ -1013,7 +1013,7 @@ fn call_to_length_in_inner_function_succeeds() {
         output_recording_callable_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
diff --git a/compiler/qsc_partial_eval/tests/misc.rs b/compiler/qsc_partial_eval/tests/misc.rs
index 6288af3d..4cdbe88c 100644
--- a/compiler/qsc_partial_eval/tests/misc.rs
+++ b/compiler/qsc_partial_eval/tests/misc.rs
@@ -301,7 +301,7 @@ fn integer_assign_with_hybrid_value_within_an_if_with_dynamic_condition() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
diff --git a/compiler/qsc_partial_eval/tests/operators.rs b/compiler/qsc_partial_eval/tests/operators.rs
index 86907b61..a36b2c37 100644
--- a/compiler/qsc_partial_eval/tests/operators.rs
+++ b/compiler/qsc_partial_eval/tests/operators.rs
@@ -58,7 +58,7 @@ fn leading_positive_unary_operator_does_not_generate_rir_instruction() {
         output_recording_callable_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -132,7 +132,7 @@ fn leading_negative_unary_operator_generates_rir_instruction() {
         output_recording_callable_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -207,7 +207,7 @@ fn bitwise_not_unary_operator_generates_rir_instruction() {
         output_recording_callable_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1137,7 +1137,7 @@ fn integer_add_with_lhs_classical_integer_and_rhs_dynamic_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1214,7 +1214,7 @@ fn integer_sub_with_lhs_dynamic_integer_and_rhs_classical_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1292,7 +1292,7 @@ fn integer_mul_with_lhs_dynamic_integer_and_rhs_dynamic_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1380,7 +1380,7 @@ fn integer_div_with_lhs_classical_integer_and_rhs_dynamic_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1477,7 +1477,7 @@ fn integer_mod_with_lhs_dynamic_integer_and_rhs_classical_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1625,7 +1625,7 @@ fn integer_bitwise_and_with_lhs_dynamic_integer_and_rhs_dynamic_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1713,7 +1713,7 @@ fn integer_bitwise_or_with_lhs_classical_integer_and_rhs_dynamic_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1790,7 +1790,7 @@ fn integer_bitwise_xor_with_lhs_dynamic_integer_and_rhs_classical_integer() {
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1868,7 +1868,7 @@ fn integer_bitwise_left_shif_with_lhs_dynamic_integer_and_rhs_dynamic_integer()
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
@@ -1956,7 +1956,7 @@ fn integer_bitwise_right_shift_with_lhs_classical_integer_and_rhs_dynamic_intege
         output_record_id,
         &expect![[r#"
             Callable:
-                name: __quantum__rt__integer_record_output
+                name: __quantum__rt__int_record_output
                 call_type: OutputRecording
                 input_type:
                     [0]: Integer
diff --git a/compiler/qsc_partial_eval/tests/output_recording.rs b/compiler/qsc_partial_eval/tests/output_recording.rs
index a83fcc41..88ecc575 100644
--- a/compiler/qsc_partial_eval/tests/output_recording.rs
+++ b/compiler/qsc_partial_eval/tests/output_recording.rs
@@ -429,7 +429,7 @@ fn output_recording_for_literal_int() {
                     output_type: <VOID>
                     body: 0
                 Callable 1: Callable:
-                    name: __quantum__rt__integer_record_output
+                    name: __quantum__rt__int_record_output
                     call_type: OutputRecording
                     input_type:
                         [0]: Integer