text:
[Bug]: INVALID_GRAPH /  Error Node (BeamSearch_node) has input size 12 not in range [min=5, max=10] when trying to build a non-openai provided Whisper model.

What happened?
When trying to build an ONNX model without multilingual support, using instructions on the whisper example page and supplying a non-openai repo (e.g. aware-ai/whisper-tiny-german) the test_transcription.py fails. Tested using venv.
(olive-env) (base) vmitro@v3629:~/projects/olive_stuff/Olive/examples/whisper$ python prepare_whisper_configs.py --model_name aware-ai/whisper-tiny-german --no_audio_decoder
(olive-env) (base) vmitro@v3629:~/projects/olive_stuff/Olive/examples/whisper$ python -m olive.workflows.run --config whisper_cpu_int8.json --setup
[2023-08-23 23:43:57,572] [INFO] [run.py:112:dependency_setup] The following packages are required in the local environment: ['onnxruntime']
[2023-08-23 23:43:57,572] [INFO] [run.py:116:dependency_setup] onnxruntime is already installed.
(olive-env) (base) vmitro@v3629:~/projects/olive_stuff/Olive/examples/whisper$ python -m olive.workflows.run --config whisper_cpu_int8.json
[2023-08-23 23:44:07,042] [WARNING] [config_utils.py:270:validate_config] Keys {'disable_search'} are not part of OrtTransformersOptimizationConfig. Ignoring them.
[2023-08-23 23:44:07,077] [DEBUG] [engine.py:675:resolve_goals] Resolving goals: {'latency': {'avg': None}}
[2023-08-23 23:44:07,077] [DEBUG] [engine.py:694:resolve_goals] No baseline got as no goal is provided the the goal is threshold
[2023-08-23 23:44:07,078] [DEBUG] [engine.py:475:run_no_search] Step no search with search point {'OnnxConversion': {}, 'OrtTransformersOptimization': {}, 'OnnxDynamicQuantization': {}, 'InsertBeamSearch': {}, 'AppendPrePostProcessingOps': {}} ...
[2023-08-23 23:44:07,078] [INFO] [engine.py:939:_run_pass] Running pass OnnxConversion
[2023-08-23 23:44:07,078] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-23 23:44:07,082] [INFO] [engine.py:939:_run_pass] Running pass OrtTransformersOptimization
[2023-08-23 23:44:07,083] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-23 23:44:07,087] [INFO] [engine.py:939:_run_pass] Running pass OnnxDynamicQuantization
[2023-08-23 23:44:07,087] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-23 23:44:07,091] [INFO] [engine.py:939:_run_pass] Running pass InsertBeamSearch
[2023-08-23 23:44:07,092] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-23 23:44:07,093] [INFO] [engine.py:939:_run_pass] Running pass AppendPrePostProcessingOps
[2023-08-23 23:44:07,094] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-23 23:44:07,095] [DEBUG] [engine.py:1076:_evaluate_model] Evaluating model ...
[2023-08-23 23:44:07,096] [DEBUG] [engine.py:1087:_evaluate_model] Loading evaluation from cache ...
[2023-08-23 23:44:07,096] [DEBUG] [engine.py:917:_run_passes] Signal: {'latency-avg': 1079.78704}
[2023-08-23 23:44:07,096] [DEBUG] [engine.py:499:run_no_search] Engine output_name is provided. Will ignore output_name for final pass
[2023-08-23 23:44:07,227] [INFO] [engine.py:384:run] Package top ranked 1 models as artifacts
[2023-08-23 23:44:07,227] [INFO] [packaging_generator.py:47:_generate_zipfile_output] Packaging Zipfile output artifacts
[2023-08-23 23:44:07,281] [DEBUG] [resource_path.py:147:create_resource_path] Resource path /tmp/tmpq7o_oxgh/CandidateModels/cpu-cpu/BestCandidateModel_1/olive_tmpkcdwbdnu/model.onnx is inferred to be of type file.
[2023-08-23 23:44:07,288] [DEBUG] [utils.py:21:run_subprocess] Running command: python -m pip download onnxruntime-extensions==0.8.0 --no-deps -d /tmp/tmpq7o_oxgh/ONNXRuntimePackages/Python with env: None
[2023-08-23 23:44:08,206] [DEBUG] [utils.py:21:run_subprocess] Running command: python -m pip download onnxruntime==1.15.1 --no-deps -d /tmp/tmpq7o_oxgh/ONNXRuntimePackages/Python with env: None
(olive-env) (base) vmitro@v3629:~/projects/olive_stuff/Olive/examples/whisper$ python test_transcription.py --config whisper_cpu_int8.json
> /home/vmitro/projects/olive_stuff/Olive/examples/whisper/test_transcription.py(71)main()
-> for model_json in output_model_json_path.glob(f"**/{config['engine']['output_name']}_cpu-cpu_model.json"):
[2023-08-23 23:45:27,367] [WARNING] [__init__.py:212:_is_valid_ep] Error: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from /home/vmitro/projects/olive_stuff/Olive/examples/whisper/models/conversion-transformers_optimization-onnx_dynamic_quantization-insert_beam_search-prepost/whisper_cpu_int8_cpu-cpu_model.onnx failed:This is an invalid model. In Node, ("BeamSearch_node", BeamSearch, "com.microsoft", -1) : ("log_mel": tensor(float),"max_length": tensor(int32),"min_length": tensor(int32),"num_beams": tensor(int32),"num_return_sequences": tensor(int32),"length_penalty": tensor(float),"repetition_penalty": tensor(float),"","","","","",) -> ("sequences",) , Error Node (BeamSearch_node) has input size 12 not in range [min=5, max=10].Olive will ignore this CPUExecutionProvider.Please make sure the environment with CPUExecutionProvider has the required dependencies.
Traceback (most recent call last):
  File "/home/vmitro/projects/olive_stuff/Olive/examples/whisper/test_transcription.py", line 108, in <module>
    output_text = main()
  File "/home/vmitro/projects/olive_stuff/Olive/examples/whisper/test_transcription.py", line 98, in main
    session = olive_model.prepare_session(None, "cpu")
  File "/home/vmitro/projects/olive_stuff/olive-env/lib/python3.10/site-packages/olive/model/__init__.py", line 346, in prepare_session
    return get_ort_inference_session(self.model_path, inference_settings, self.use_ort_extensions)
  File "/home/vmitro/projects/olive_stuff/olive-env/lib/python3.10/site-packages/olive/common/ort_inference.py", line 64, in get_ort_inference_session
    sess = ort.InferenceSession(
  File "/home/vmitro/projects/olive_stuff/olive-env/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 383, in __init__
    self._create_inference_session(providers, provider_options, disabled_optimizers)
  File "/home/vmitro/projects/olive_stuff/olive-env/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 424, in _create_inference_session
    sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidGraph: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from /home/vmitro/projects/olive_stuff/Olive/examples/whisper/models/conversion-transformers_optimization-onnx_dynamic_quantization-insert_beam_search-prepost/whisper_cpu_int8_cpu-cpu_model.onnx failed:This is an invalid model. In Node, ("BeamSearch_node", BeamSearch, "com.microsoft", -1) : ("log_mel": tensor(float),"max_length": tensor(int32),"min_length": tensor(int32),"num_beams": tensor(int32),"num_return_sequences": tensor(int32),"length_penalty": tensor(float),"repetition_penalty": tensor(float),"","","","","",) -> ("sequences",) , Error Node (BeamSearch_node) has input size 12 not in range [min=5, max=10].

When installing the latest onnxruntime (1.16.0-dev*) through python -m pip install ort-nightly --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/ the transcription seems to work (haven't tested with a audio file with spoken German, but the supplied file gets transcribed into a German-looking text).
When loaded into the Android ONNX Runtime (latest ver 1.15.1) I get exactly the same error. When I compare the two repos' config.json files (openai's and the aforementioned), some decoder_* and encoder_* options differ.
Could this be a ONNX Runtime bug? I'm currently building Android runtime from source, will report if I get it to work using my build.
Version?
Olive: 0.3.1
ONNX Runtime: 1.15.1

This is because of the mismatch between the versions of the onnxruntime versions used to build the model and run it. The beam search node has changed between the stable 1.15.1 version and the nightly version.
Hence, this error Error Node (BeamSearch_node) has input size 12 not in range [min=5, max=10].
If you don't need multilingual support (for instance your model is finetuned on german so it always produces german text), please run the workflow again with onnxruntime 1.15.1 installed.
If you need multilingual support, then the workflow must be run with onnxruntime nightly and your the onnxruntime used for inference must also be nightly (or built from source)

Well, interestingly, that seems not to be that case.
After creating a Python 3.8 conda environment, building Olive from source like here and then running a bash script to take the model name from an env variable and run through the steps to compile a CPU/INT8 model, I got the same error.
(olive) vmitro@v3629:~/projects/olive_stuff/Olive/examples/whisper$ export MODEL_NAME=aware-ai/whisper-tiny-german
(olive) vmitro@v3629:~/projects/olive_stuff/Olive/examples/whisper$ ./maek_model.sh
[2023-08-24 09:53:18,802] [INFO] [run.py:112:dependency_setup] The following packages are required in the local environment: ['onnxruntime']
[2023-08-24 09:53:18,802] [INFO] [run.py:116:dependency_setup] onnxruntime is already installed.
[2023-08-24 09:53:21,758] [WARNING] [config_utils.py:270:validate_config] Keys {'disable_search'} are not part of OrtTransformersOptimizationConfig. Ignoring them.
[2023-08-24 09:53:21,792] [DEBUG] [engine.py:675:resolve_goals] Resolving goals: {'latency': {'avg': None}}
[2023-08-24 09:53:21,793] [DEBUG] [engine.py:694:resolve_goals] No baseline got as no goal is provided the the goal is threshold
[2023-08-24 09:53:21,793] [DEBUG] [engine.py:475:run_no_search] Step no search with search point {'OnnxConversion': {}, 'OrtTransformersOptimization': {}, 'OnnxDynamicQuantization': {}, 'InsertBeamSearch': {}, 'AppendPrePostProcessingOps': {}} ...
[2023-08-24 09:53:21,793] [INFO] [engine.py:939:_run_pass] Running pass OnnxConversion
[2023-08-24 09:53:21,793] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-24 09:53:21,797] [INFO] [engine.py:939:_run_pass] Running pass OrtTransformersOptimization
[2023-08-24 09:53:21,798] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-24 09:53:21,802] [INFO] [engine.py:939:_run_pass] Running pass OnnxDynamicQuantization
[2023-08-24 09:53:21,803] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-24 09:53:21,807] [INFO] [engine.py:939:_run_pass] Running pass InsertBeamSearch
[2023-08-24 09:53:21,807] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-24 09:53:21,810] [INFO] [engine.py:939:_run_pass] Running pass AppendPrePostProcessingOps
[2023-08-24 09:53:21,810] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-24 09:53:21,812] [DEBUG] [engine.py:1076:_evaluate_model] Evaluating model ...
[2023-08-24 09:53:21,812] [DEBUG] [engine.py:1087:_evaluate_model] Loading evaluation from cache ...
[2023-08-24 09:53:21,813] [DEBUG] [engine.py:917:_run_passes] Signal: {'latency-avg': 1079.78704}
[2023-08-24 09:53:21,813] [DEBUG] [engine.py:499:run_no_search] Engine output_name is provided. Will ignore output_name for final pass
[2023-08-24 09:53:21,897] [INFO] [engine.py:384:run] Package top ranked 1 models as artifacts
[2023-08-24 09:53:21,897] [INFO] [packaging_generator.py:47:_generate_zipfile_output] Packaging Zipfile output artifacts
[2023-08-24 09:53:21,968] [DEBUG] [resource_path.py:147:create_resource_path] Resource path /tmp/tmpfjp241j3/CandidateModels/cpu-cpu/BestCandidateModel_1/olive_tmpq4g6kd86/model.onnx is inferred to be of type file.
[2023-08-24 09:53:21,976] [DEBUG] [utils.py:21:run_subprocess] Running command: python -m pip download onnxruntime-extensions==0.8.0 --no-deps -d /tmp/tmpfjp241j3/ONNXRuntimePackages/Python with env: None
[2023-08-24 09:53:22,788] [DEBUG] [utils.py:21:run_subprocess] Running command: python -m pip download onnxruntime==1.15.1 --no-deps -d /tmp/tmpfjp241j3/ONNXRuntimePackages/Python with env: None
[2023-08-24 09:53:46,103] [WARNING] [__init__.py:212:_is_valid_ep] Error: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from /home/vmitro/projects/olive_stuff/Olive/examples/whisper/models/conversion-transformers_optimization-onnx_dynamic_quantization-insert_beam_search-prepost/whisper_cpu_int8_cpu-cpu_model.onnx failed:This is an invalid model. In Node, ("BeamSearch_node", BeamSearch, "com.microsoft", -1) : ("log_mel": tensor(float),"max_length": tensor(int32),"min_length": tensor(int32),"num_beams": tensor(int32),"num_return_sequences": tensor(int32),"length_penalty": tensor(float),"repetition_penalty": tensor(float),"","","","","",) -> ("sequences",) , Error Node (BeamSearch_node) has input size 12 not in range [min=5, max=10].Olive will ignore this CPUExecutionProvider.Please make sure the environment with CPUExecutionProvider has the required dependencies.
Traceback (most recent call last):
  File "test_transcription.py", line 108, in <module>
    output_text = main()
  File "test_transcription.py", line 98, in main
    session = olive_model.prepare_session(None, "cpu")
  File "/home/vmitro/miniconda3/envs/olive/lib/python3.8/site-packages/olive/model/__init__.py", line 346, in prepare_session
    return get_ort_inference_session(self.model_path, inference_settings, self.use_ort_extensions)
  File "/home/vmitro/miniconda3/envs/olive/lib/python3.8/site-packages/olive/common/ort_inference.py", line 64, in get_ort_inference_session
    sess = ort.InferenceSession(
  File "/home/vmitro/miniconda3/envs/olive/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 383, in __init__
    self._create_inference_session(providers, provider_options, disabled_optimizers)
  File "/home/vmitro/miniconda3/envs/olive/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 424, in _create_inference_session
    sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidGraph: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from /home/vmitro/projects/olive_stuff/Olive/examples/whisper/models/conversion-transformers_optimization-onnx_dynamic_quantization-insert_beam_search-prepost/whisper_cpu_int8_cpu-cpu_model.onnx failed:This is an invalid model. In Node, ("BeamSearch_node", BeamSearch, "com.microsoft", -1) : ("log_mel": tensor(float),"max_length": tensor(int32),"min_length": tensor(int32),"num_beams": tensor(int32),"num_return_sequences": tensor(int32),"length_penalty": tensor(float),"repetition_penalty": tensor(float),"","","","","",) -> ("sequences",) , Error Node (BeamSearch_node) has input size 12 not in range [min=5, max=10].

(olive) vmitro@v3629:~/projects/olive_stuff/Olive/examples/whisper$ export MODEL_NAME=aware-ai/whisper-base-german
(olive) vmitro@v3629:~/projects/olive_stuff/Olive/examples/whisper$ ./maek_model.sh
[2023-08-24 09:55:29,475] [INFO] [run.py:112:dependency_setup] The following packages are required in the local environment: ['onnxruntime']
[2023-08-24 09:55:29,475] [INFO] [run.py:116:dependency_setup] onnxruntime is already installed.
[2023-08-24 09:55:32,336] [WARNING] [config_utils.py:270:validate_config] Keys {'disable_search'} are not part of OrtTransformersOptimizationConfig. Ignoring them.
[2023-08-24 09:55:32,366] [DEBUG] [engine.py:675:resolve_goals] Resolving goals: {'latency': {'avg': None}}
[2023-08-24 09:55:32,366] [DEBUG] [engine.py:694:resolve_goals] No baseline got as no goal is provided the the goal is threshold
[2023-08-24 09:55:32,366] [DEBUG] [engine.py:475:run_no_search] Step no search with search point {'OnnxConversion': {}, 'OrtTransformersOptimization': {}, 'OnnxDynamicQuantization': {}, 'InsertBeamSearch': {}, 'AppendPrePostProcessingOps': {}} ...
[2023-08-24 09:55:32,367] [INFO] [engine.py:939:_run_pass] Running pass OnnxConversion
[2023-08-24 09:55:32,367] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-24 09:55:32,371] [INFO] [engine.py:939:_run_pass] Running pass OrtTransformersOptimization
[2023-08-24 09:55:32,372] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-24 09:55:32,376] [INFO] [engine.py:939:_run_pass] Running pass OnnxDynamicQuantization
[2023-08-24 09:55:32,376] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-24 09:55:32,381] [INFO] [engine.py:939:_run_pass] Running pass InsertBeamSearch
[2023-08-24 09:55:32,381] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-24 09:55:32,383] [INFO] [engine.py:939:_run_pass] Running pass AppendPrePostProcessingOps
[2023-08-24 09:55:32,383] [DEBUG] [engine.py:957:_run_pass] Loading model from cache ...
[2023-08-24 09:55:32,385] [DEBUG] [engine.py:1076:_evaluate_model] Evaluating model ...
[2023-08-24 09:55:32,385] [DEBUG] [engine.py:1087:_evaluate_model] Loading evaluation from cache ...
[2023-08-24 09:55:32,385] [DEBUG] [engine.py:917:_run_passes] Signal: {'latency-avg': 1396.85263}
[2023-08-24 09:55:32,386] [DEBUG] [engine.py:499:run_no_search] Engine output_name is provided. Will ignore output_name for final pass
[2023-08-24 09:55:32,511] [INFO] [engine.py:384:run] Package top ranked 1 models as artifacts
[2023-08-24 09:55:32,511] [INFO] [packaging_generator.py:47:_generate_zipfile_output] Packaging Zipfile output artifacts
[2023-08-24 09:55:32,632] [DEBUG] [resource_path.py:147:create_resource_path] Resource path /tmp/tmpk6ssiia2/CandidateModels/cpu-cpu/BestCandidateModel_1/olive_tmpx24pxtyp/model.onnx is inferred to be of type file.
[2023-08-24 09:55:32,640] [DEBUG] [utils.py:21:run_subprocess] Running command: python -m pip download onnxruntime-extensions==0.8.0 --no-deps -d /tmp/tmpk6ssiia2/ONNXRuntimePackages/Python with env: None
[2023-08-24 09:55:33,419] [DEBUG] [utils.py:21:run_subprocess] Running command: python -m pip download onnxruntime==1.15.1 --no-deps -d /tmp/tmpk6ssiia2/ONNXRuntimePackages/Python with env: None
['Gedownes Church ist durch Wimbledd, dieÄquem ist, oberstehende Eis, eventuell in der Arena, Roundham, wird zuvor nicht im Speck gedurch, und für die Arreby ist noch was dünktig gebaut.']

However, as you can see, running the same steps with another model (the base variant) seems to work - the only problem being, it is really heavy and I must put android:largeHeap="true" inside my app's AndroidManifest.xml. On the other side, the base version is noticeably better at recognition.
The onnxruntime's version remained the same between the two invocations.
(olive) vmitro@v3629:~/projects/olive_stuff/Olive/examples/whisper$ pip show onnxruntime
Name: onnxruntime
Version: 1.15.1
Summary: ONNX Runtime is a runtime accelerator for Machine Learning models
Home-page: https://onnxruntime.ai
Author: Microsoft Corporation
Author-email: onnxruntime@microsoft.com
License: MIT License
Location: /home/vmitro/miniconda3/envs/olive/lib/python3.8/site-packages
Requires: coloredlogs, flatbuffers, numpy, packaging, protobuf, sympy
Required-by:

Here's the listing of the simple bash script used:
(olive) vmitro@v3629:~/projects/olive_stuff/Olive/examples/whisper$ cat maek_model.sh

#!/bin/bash

if [ -z "$MODEL_NAME" ]; then
    echo "Run $ export MODEL_NAME=repo/model-name to run automated conversion to CPU with INT8!"
    exit 1
fi

python prepare_whisper_configs.py --model_name $MODEL_NAME --no_audio_decoder && \
python -m olive.workflows.run --config whisper_cpu_int8.json --setup && \
python -m olive.workflows.run --config whisper_cpu_int8.json 2> /dev/null
if [ $? -eq 0 ]; then
    python test_transcription.py --config whisper_cpu_int8.json
else
    echo "Model conversion failed"
fi

I am going to try it (yet) again, this time with pip's olive_ai package. Will report my findings.

Oh that's because it is using a cached run as none of the configs changed. Your original run with the nightly version must have been cached.

Can you run the workflow again after deleting the cache subdir in your working directory?
You can also set "clean_cache": true under engine in the whisper_template.json to do the same.
Can you try again with this change?

That did the trick, thank you very much!
(olive) vmitro@v3629:~/projects/olive_stuff/Olive/examples/whisper$ MODEL_NAME=aware-ai/whisper-tiny-german ./maek_model.sh
[2023-08-24 20:46:15,803] [INFO] [run.py:112:dependency_setup] The following packages are required in the local environment: ['onnxruntime']
[2023-08-24 20:46:15,803] [INFO] [run.py:116:dependency_setup] onnxruntime is already installed.
[2023-08-24 20:46:18,698] [WARNING] [config_utils.py:270:validate_config] Keys {'disable_search'} are not part of OrtTransformersOptimizationConfig. Ignoring them.
[2023-08-24 20:46:18,722] [DEBUG] [engine.py:675:resolve_goals] Resolving goals: {'latency': {'avg': None}}
[2023-08-24 20:46:18,722] [DEBUG] [engine.py:694:resolve_goals] No baseline got as no goal is provided the the goal is threshold
[2023-08-24 20:46:18,723] [DEBUG] [engine.py:475:run_no_search] Step no search with search point {'OnnxConversion': {}, 'OrtTransformersOptimization': {}, 'OnnxDynamicQuantization': {}, 'InsertBeamSearch': {}, 'AppendPrePostProcessingOps': {}} ...
[2023-08-24 20:46:18,723] [INFO] [engine.py:939:_run_pass] Running pass OnnxConversion
[2023-08-24 20:46:18,723] [DEBUG] [engine.py:801:_prepare_non_local_model] Model path is None, local or string name. No need to prepare
[2023-08-24 20:46:24,445] [DEBUG] [__init__.py:570:get_dummy_inputs] Using dummy_inputs_func to get dummy inputs
============= Diagnostic Run torch.onnx.export version 2.0.1+cu117 =============
verbose: False, log level: Level.ERROR
======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ========================

[2023-08-24 20:46:31,671] [DEBUG] [__init__.py:570:get_dummy_inputs] Using dummy_inputs_func to get dummy inputs
============= Diagnostic Run torch.onnx.export version 2.0.1+cu117 =============
verbose: False, log level: Level.ERROR
======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ========================

[2023-08-24 20:46:33,604] [INFO] [engine.py:939:_run_pass] Running pass OrtTransformersOptimization
[2023-08-24 20:46:33,605] [DEBUG] [engine.py:801:_prepare_non_local_model] Model path is None, local or string name. No need to prepare
[2023-08-24 20:46:40,699] [INFO] [engine.py:939:_run_pass] Running pass OnnxDynamicQuantization
[2023-08-24 20:46:40,700] [DEBUG] [engine.py:801:_prepare_non_local_model] Model path is None, local or string name. No need to prepare
[2023-08-24 20:46:40,701] [INFO] [quantization.py:340:_run_for_config] Preprocessing model for quantization
[2023-08-24 20:46:50,864] [INFO] [quantization.py:340:_run_for_config] Preprocessing model for quantization
[2023-08-24 20:46:59,281] [INFO] [engine.py:939:_run_pass] Running pass InsertBeamSearch
[2023-08-24 20:46:59,282] [DEBUG] [engine.py:801:_prepare_non_local_model] Model path is None, local or string name. No need to prepare
Removed 40 initializers with duplicated value
Removed 24 initializers with duplicated value
[2023-08-24 20:47:03,356] [DEBUG] [insert_beam_search.py:140:chain_model] Using IR version 8 for chained model
[2023-08-24 20:47:03,817] [INFO] [engine.py:939:_run_pass] Running pass AppendPrePostProcessingOps
[2023-08-24 20:47:03,817] [DEBUG] [engine.py:801:_prepare_non_local_model] Model path is None, local or string name. No need to prepare
============= Diagnostic Run torch.onnx.export version 2.0.1+cu117 =============
verbose: False, log level: Level.ERROR
======================= 0 NONE 0 NOTE 1 WARNING 0 ERROR ========================
1 WARNING were not printed due to the log level.

[2023-08-24 20:47:07,605] [DEBUG] [engine.py:1076:_evaluate_model] Evaluating model ...
[2023-08-24 20:47:07,605] [DEBUG] [engine.py:801:_prepare_non_local_model] Model path is None, local or string name. No need to prepare
[2023-08-24 20:47:07,642] [DEBUG] [olive_evaluator.py:194:generate_metric_user_config_with_model_io] Model input shapes are not static. Cannot use inferred input shapes for creating dummy data. This will cause an error when creating dummy data for tuning.
[2023-08-24 20:47:07,643] [DEBUG] [resource_path.py:147:create_resource_path] Resource path /home/vmitro/projects/olive_stuff/Olive/examples/whisper/data is inferred to be of type folder.
[2023-08-24 20:47:29,114] [DEBUG] [engine.py:917:_run_passes] Signal: {'latency-avg': 662.4}
[2023-08-24 20:47:29,114] [DEBUG] [engine.py:499:run_no_search] Engine output_name is provided. Will ignore output_name for final pass
[2023-08-24 20:47:29,201] [INFO] [engine.py:384:run] Package top ranked 1 models as artifacts
[2023-08-24 20:47:29,201] [INFO] [packaging_generator.py:47:_generate_zipfile_output] Packaging Zipfile output artifacts
[2023-08-24 20:47:29,258] [DEBUG] [resource_path.py:147:create_resource_path] Resource path /tmp/tmpat5y95kv/CandidateModels/cpu-cpu/BestCandidateModel_1/olive_tmphlyxy0gl/model.onnx is inferred to be of type file.
[2023-08-24 20:47:29,260] [DEBUG] [utils.py:21:run_subprocess] Running command: python -m pip download onnxruntime-extensions==0.8.0 --no-deps -d /tmp/tmpat5y95kv/ONNXRuntimePackages/Python with env: None
[2023-08-24 20:47:30,118] [DEBUG] [utils.py:21:run_subprocess] Running command: python -m pip download onnxruntime==1.15.1 --no-deps -d /tmp/tmpat5y95kv/ONNXRuntimePackages/Python with env: None
['Der traditionlich trifft historisch den Worten, die echte wichtig sind, ebenso sollen ihre Erwährendung bezahlreichen Sprengen verbaut.']

It even sounds reads more German :D
Sooo... because hot-swapping onnxruntime versions is not really the workflow that one would usually employ, I should just close the issue as completed. You could maybe add your tip about deleting cache or enabling the clean_cache to the readme, in case anyone gets stuck like I did?

Yes, I will! I am planning to add a note about the versions mismatch and cleaning the cache to the readme.
Someone else also had an issue with the ort versions mismatch. I suspect the cache thing will come up too.
Thanks for reporting them!

No problem, thank you for your timely responses!

authors: jambayk vmitro

repo: microsoft/Olive


text:
Is there an ETA for the next release?

I'm using features in the vnext branch and I'm wondering when they will be available in a NuGet package.

Hey John!  Christmas is coming.  I'm hoping to get some time to work on this in the next couple of weeks while it is quiet at work.

source: gharchive/issue

authors: darrelmiller john-vellozzi-avalara

license: MIT

license_type: permissive

license_source: github-api


text:
Lag with Anaconda/IPython interactive

With IPython interactive mode enabled, first initialize the interactive window (with any valid code)
At the beginning of a prompt, type a few non-numeric character and you'll have a 2-5 seconds lag before they appear.
There's no lag if you type a number or #.
Also reported at https://developercommunity.visualstudio.com/content/problem/289052/vs-python-lag-with-anacondaipython-interactive-env.html

This is just triggering IntelliSense. Once we switch to a fully async completion API, this should go away.

Has there been any progress on this? I find the interactive mode extremely useful, but the delay makes it nearly unusable to type code into directly. Is there a way I can disable intellisense on the interactive window entirely until this is resolved?

@BrianMWest, we're working on integrating the language server client with the language server protocol which should speeds things up.
There is no way to disable intelligent in the interactive window.

Just to weigh in, hoping it might help with prioritization, I'm experiencing this issue as well.
I'd be happy to work with a temporary solution as well, so that I can keep an otherwise very satisfying experience :)

I have the same issue as well, hopefully it would be repaired soon. The interactive window is very useful otherwise, but its sometimes very frustrating to use due to the lag.

@saarinea I've largely given up and am just using Spyder now.  If you want, I have a repo with just the basic library requirements at the following link:
https://github.com/MarkMoretto/spyder-master
If you're using Windows 7/8.1/10:

Clone it

Create a virtual environment (preferably, named "venv")

Install ~\requirements\core.txt file:
C:\>venv\Scripts\python.exe -m pip install -r requirements\core.txt

Run it with the batch script the root folder:
Spyder-IDE.bat

If you try it and have any issues, let me know!

@MarkMoretto I actually have a Spyder installation going on as well, but thank you anyways!

Why was this issue closed? @greazer

authors: BrianMWest MarkMoretto RaymonGulati1 huguesv oguzhanogreden saarinea zooba

repo: microsoft/PTVS


text:
Added named formula class

This PR creates a class for Named Formulas. It also adds a constructor for Formula that takes an already parsed parse tree. This is so that when named formulas are parsed, their right-hand sides can be Formula objects without re-parsing.

Please add some tests parsing and constructing NamedFormulas

Please add some tests parsing and constructing NamedFormulas

Added

source: gharchive/pull-request

repo: microsoft/Power-Fx


text:
Components hash mismatch with AllowAccessToGlobals property value changed

Components hash mismatch with AllowAccessToGlobals property value changed while unpacking the .msapp
Describe the bug
Reproducible using pac and pasopa unpack
To Reproduce
Steps to reproduce the behavior:

Unpacking

Screenshots
If applicable, add screenshots of error messages to help explain your problem.

Additional context

This is a known issue with apps generated in a previous version of Power Apps Studio where the property in the msapp associated with the Access App Scope property for a custom component can get out of sync with other same property in other locations within the msapp file structure. We've documented the resolution steps via a workaround for this and other similar known issues in our Known Issues document

authors: NavneetThekkumpat arpavan

repo: microsoft/PowerApps-Language-Tooling


text:
Updated swagger definition due to API changes

Modified capital from integer to number

Hi @sriyen-msft  exactly we had to change the type of the output field "capital" from integer to number as there was an update yesterday on the API. The capital value has been changed to Float by the owner of the service and we got notified yesterday afternoon. The reasoning for that is because they were rounding up the capital value and after some feedback from the users of the API the owner of the service is no longer rounding up the value but leaving it as a float.
If a Power Automate user tries to retrieve company information that contain the capital they will receive an error message like this one:

The change that we did was modifying the type expected in the API definition to be number rather than integer so it doesn' t break when receiving a float value from the service.
Screenshot of updated custom connector:

Screesshot of the output showing a float value on the capital field:

Any other question please let us know.
Thank you for your help!

@mtcantero Update - We are preparing your connector for the next deployment schedule. Once your connector onboards the next deployment schedule, it starts to deploy your connector in our production environments that typically takes between 7-10 business days. Please note that the documentation for your connector will not be generated until the deployment process is in the final steps. Thanks

[[certify-connector]]

@mtcantero Deployment freeze notice: Due to Thanksgiving week in the United States, we have temporarily halted the deployments of all the connectors till Tuesday, 30th November 2021. So we will not be able to deploy your connector to the next production region.
We will begin the deployments on Wednesday, 1st December 2021, and the production deployment of your connector in all regions will be expected to be completed by Thursday, 2nd December 2021. Thanks

Thanks @sriyen-msft ! Have a fantastic Thanksgiving weekend and talk to you on December 1st!

@mtcantero Congratulations! The deployment of your connector and documentation page is now complete, We have a short survey on the connector certification process that we would like for you to complete. Your feedback is appreciated and will help us improve the program. Thanks

authors: mtcantero sriyen-msft

repo: microsoft/PowerPlatformConnectors


text:
Adding Taqnyat SMS connector (certified-connectors)

When submitting a connector, please make sure that you follow the requirements below, otherwise your PR might be rejected. We want to make you have a well-built connector, a smooth certification experience, and your users are happy :)
If this is your first time submitting to GitHub and you need some help, please sign up for this session.

[X] I attest that the connector doesn't exist on the Power Platform today. I've verified by checking the pull requests in GitHub and by searching for the connector on the platform or in the documentation.
[X ] I attest that the connector works and I verified by deploying and testing all the operations.
[X ] I attest that I have added detailed descriptions for all operations and parameters in the swagger file.
[X ] I attest that I have added response schemas to my actions, unless the response schema is dynamic.
[X ] I validated the swagger file, apiDefinition.swagger.json, by running paconn validate command.
[ X] If this is a certified connector, I confirm that apiProperties.json has a valid brand color and doesn't use an invalid brand color, #007ee5 or #ffffff. If this is an independent publisher connector, I confirm that I am not submitting a connector icon.

If you are an Independent Publisher, you must also attest to the following to ensure a smooth publishing process:

[ ] I have named this PR after the pattern of "Connector Name (Independent Publisher)" ex: HubSpot Marketing (Independent Publisher)
[ ] Within this PR markdown file, I have pasted screenshots that show: 3 unique operations (actions/triggers) working within a Flow. This can be in one flow or part of multiple flows. For each one of those flows, I have pasted in screenshots of the Flow succeeding.
[ ] Within this PR markdown file, I have pasted in a screenshot from the Test operations section within the Custom Connector UI.
[ ] If the connector uses OAuth, I have provided detailed steps on how to create an app in the readme.md.

Note , I just followed Swagger standered specification by implement at least one 4XX response .

@microsoft-github-policy-service agree [company="{Taqnyat.sa}"]

@microsoft-github-policy-service agree company="Taqnyat.sa"

Hi @TaqnyatNocTeam, Thank you so much for submitting your connector. As we ask all verified publisher to register their connector, may I ask you please to register your connector for certification by filling out our registration form.
Please let me know if you have any questions.
Thank you very much.

Done , Thanks

Hi @TaqnyatNocTeam, Thank you so much for submitting your connector. As we ask all verified publisher to register their connector, may I ask you please to register your connector for certification by filling out our registration form. Please let me know if you have any questions. Thank you very much.
Sorry , I missed this step .
Done , Thanks

@Amjed-Ayoub , All validation issues was fixed ,
Thanks for your assistance .

Hello @TaqnyatNocTeam,
I hope you are doing well.
Congratulations, your pull request is approved and merged. Please submit the files to ISV Studio or update your submission using your latest commit ID, please allow us up to 1-2 weeks to review your submission, and our Engineers will notify you in the “Activity Control” area in ISV Studio. Please make sure that the icon meets all the requirements, that it’s size is 230x230, icon background is not white or transparent and it matches the iconBrandColor property in apiProperties.json file.
After making the submission in ISV Studio, please attach an intro.md file in the activity control section. This file is required and it's different from readme.md. You can find an example of intro.md file on this page at step 6.
Please Create an environment in the Preview region. You will use this environment later to test your connector after Microsoft is done with the functional verification for your connector.
We expect all tests to be completed within 1-2 weeks.
If your connector passes all tests, the deployment process begins, and it typically takes up to 3 to 4 weeks to deploy your connector to all of our regions.
Please let me know if you have any questions or run into any problems while creating or updating your submission.
Thank you very much for working with us.

authors: Amjed-Ayoub TaqnyatNocTeam


text:
Create newtestfile.md

Please check the following conditions for your PR.

[ ] apiDefinition.swagger.json is validated using paconn validate command.
[ ] apiProperties.json has a valid brand color. Invalid brand colors are #007ee5 and #ffffff.

By mistake


text:
Persistent "focus mode blockout layer" even after exiting PowerToys

Microsoft PowerToys version
0.37.2
Running as admin

[ ] Yes

Area(s) with issue?
FancyZones
Steps to reproduce

using FancyZones normally (3 column, no fucus), dragging between columns,
Focus Template "block-out-window" just appears with no way to close it.
block-out-window: semitransparent layer covering the whole desktop.

PowerToysReport_2021-06-23-22-58-20.zip
✔ Expected Behavior

closing PowerToy should close all Fancy Zone created features
looking for a stuck process in Task Manager... non I could find
restarting all File Explorer processes should kill any extra windows.

❌ Actual Behavior

Focus block out "window" persist after closing
all Windows Explorer proecesses doesn't remove the block-out
have to restart Windows... Loosing ALLL my desktop+virtual desktops settings and layouts!12

Other Software
No response

is this still an issue with PowerToys?  We've done a lot of improvements.

This has been fixed, or hasn't come up since.

authors: crutkas minedefine

repo: microsoft/PowerToys


text:
Power Rename Closes File Explorer

Microsoft PowerToys version
0.41.4
Running as admin

[ ] Yes

Area(s) with issue?
PowerRename
Steps to reproduce
Renaming multiple files with only the Use Regular Expressions option checked, completes the rename properly BUT then closes the File Explorer window. Note: my account has admin privilege's.
Update: Subsequent renames have worked as expected without closing File Explorer; a fluke?
✔ Expected Behavior
Leave File Explorer as is.
❌ Actual Behavior
File Explorer closed.
Other Software
No response

Thanks for reporting this @JPB46, can you attach the logs generated from the bug report tool?

I'm not able to repro on my machine unfortunately, so it may be hard to diagnose exactly what happened here.

Thank you for your reply. I believe this is no longer an issue and is not
repeatable. Please consider this closed.
John B.
On Tue, Jul 20, 2021 at 4:59 PM Deondre Davis @.***>
wrote:

Thanks for reporting this @JPB46 https://github.com/JPB46, can you
attach the logs generated from the bug report tool?
[image: image]
https://user-images.githubusercontent.com/61330599/126394489-c0b36ba7-07e3-4152-826e-3ff54a69f56d.png
I'm not able to repro on my machine unfortunately, so it may be hard to
diagnose exactly what happened here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/PowerToys/issues/12245#issuecomment-883704075,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALO76DVP5FSYDO7YP55UJPLTYXPRZANCNFSM475IVUXQ
.

Ok I see. We'll close this for now, but if it presents again in the future please let us know. Thanks!


text:
Move EXE args to docs.msft

Provide a description of requested docs changes
https://github.com/microsoft/PowerToys/wiki/Installer-arguments-for-exe should actually be in docs

https://github.com/MicrosoftDocs/windows-uwp/pull/3533

Pr for docs done.  Need to update aka link and wiii page now


text:
Zone highlight Opacity (%) is misleading

Zone highlight Opacity (%) is misleading.
Judging by it's name is should affect only highlighted zone. It does effect all zones.
Zone highlight Opacity (%) - > Zone Opacity (%)

I guess we can rename it to just "Zone Opacity"

Agreed

The fix is now available in 0.16 https://github.com/microsoft/PowerToys/releases

authors: PrzemyslawTusinski crutkas enricogior


text:
[CI][Test]Test runs are timing out and

Microsoft PowerToys version
0.60.0-dev
Running as admin

[ ] Yes

Area(s) with issue?
General
Steps to reproduce
Open a PR and to when tests run they timout.
Currently suspect is that CI machines updated the WebView2 version and it's no longer working.
✔ Expected Behavior
Tests pass.
❌ Actual Behavior
Tests timeout.
Other Software
No response

The strange thing is that restarting pipeline fuxes that for my pr.

WebView2 fix will roll out early sept so this can go in in .63

authors: crutkas htcfreek jaimecbernardo


text:
Text Extractor gets stuck on grey screen when selecting Hindi text

Microsoft PowerToys version
0.62.0
Running as admin

[X] Yes

Area(s) with issue?
TextExtractor
Steps to reproduce
Open any website with hindi text in it. example wikipedia page
Select the text written in hindi
✔ Expected Behavior
The text should be scanned by OCR and copied to clipboard
❌ Actual Behavior
After selecting the text in hindi, text extractor is stuck on grey screen and nothing it copied to clipboard
I have Hindi language pack and input method installed and the issue persists even when Hindi is selected as input method
During selection:

After selection:

Other Software
No response

Hi @agrmohit , is the Hindi language pack installed in your Windows?

/needinfo

@agrmohit, could you please run next command in the Powershell in administrator mode:
PS C:\Windows\system32> Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*' }
It will return the list of OCR packages and their statuses. Once you have it, please send the output.

Yes, correct. Currently it's not supported by Windows OCR.

Thank you for the info. Bengali language also not supporting by powertoys. I tried several time

authors: Rayhansky agrmohit jaimecbernardo taras-janea


text:
All text in the PowerToys settings window is fuzzy on displays with scale factor > 100%

Microsoft PowerToys version
0.63.0
Running as admin

[ ] Yes

Area(s) with issue?
Settings
Steps to reproduce
Open the PowerToys settings window on a display with a scale factor set to > 100%. I tested this on a Surface Book 2 with a display resolution of 3240 x 2160 and a scale setting of 200%. Then compare the fonts with those of the Windows 11 settings app.
✔ Expected Behavior
The text in the PowerToys settings window should appear crisp for all display scale settings.
❌ Actual Behavior
PowerToys font in the settings window is fuzzy at a scale setting of 200%. Check out this screenshot with the PowerToys text on the left and the Windows settings text on the right. The font of the settings window is crystal clear whereas the PowerToys settings font looks too bold and appears fuzzy at the edges.

Other Software
No response

This issue was caused by an incorrect high DPI setting for Powertoys on my computer. After fixing the setting, everything looks and behaves normally now.
You can close this issue.


text:
[Peek] Plugin pattern to enable any file type previewing

Create an internal plugin system that enables developers to easily interface plugins that render specific file types.

Support bitmap rendering via the Image control
Support web content rendering via WebView2

Does a plugin management like in PT Run makes sense?

A plugin for drives showing its name, icon, type/format, total space, free space, used space and a space graphic would be nice.

authors: SamChaps htcfreek


text:
[MWB] Share Clipboard Not Working When "Use Service" Enabled

Microsoft PowerToys version
0.70.1
Installation method
PowerToys auto-update
Running as admin
Yes
Area(s) with issue?
Mouse Without Borders
Steps to reproduce

Turn on "Use Service" in MWB for all devices.
Try to share clipboard across devices.

✔ Expected Behavior
Sharing of clipboard working across devices with "Use Service" enabled. With it disabled, it's working again.
❌ Actual Behavior
Clipboard is not sharing across devices.
Other Software
No response
Additional Related Info
Not sure if this is a bug so not opening it as a new issue, but when clicking on "Uninstall service" there's nothing happening, at least visually. So I'm not sure if the service is actually uninstalled. Is this intended?

I am having issues with the clipboard as well. I turned off run as service on one computer and is working so far.

This also happens for me

Thanks @jakebacker. As mentioned in #27260, the clipboard works initially for me when service mode is on, but stops working after Ctrl+Alt+Del has been pressed. I need to restart MWB to get the clipboard to work again.
This doesn't happen when service mode is off.

Are you still experiencing this issue? /needinfo

authors: SharpRT brittadams cinnamon-msft jakebacker yur1xpp


text:
FancyZones when Task Bar set to auto-hide

Microsoft PowerToys version
0.70.1
Installation method
Microsoft Store
Running as admin
No
Area(s) with issue?
FancyZones
Steps to reproduce
Go to taskbar settings, select, auto hide the taskbar in desktop mode.
Go to fancy zones, create any number of zones. Avaliable screen area won't consider task bar and let you place zones using %100 of screen.
✔ Expected Behavior
I was expecting a bottom line area to be "reserved" for taskbar, because in order to hidden taskbar to appear and to be usable, other application windows should not be there.
When you do not have the auto hide function for taskbar, Fancy Zones do not use that area for zones as expected.
❌ Actual Behavior
Any app or browser windows expand to the bottom of the screen, thus when you show your taskbar, they overlap, causing loss of visibility and function. You cannot use stuff that is on bottom of the window, because when you try to do, taskbar appears instead.
Other Software
No response

/dup https://github.com/microsoft/PowerToys/issues/24475

authors: Lanetolsun cinnamon-msft


text:
[PowerToys Run] Show keyboard shortcut in icon hover text

Summary of the new feature/enhancement
I'd love to see the keyboard shortcuts for "advanced" list item actions (run as admin, open containing folder, ...) mentioned in the icons hover text.
I.e. Open containing folder (Ctrl+E):

Reason
It helps me "learn" those shortcuts. As long as I don't have them in my muscle memory, I'd have to look them up every time I'd like to use them. Having no easy way to look them up leads to me not using those shortcuts at all. Especially the ones, I don't need on a daily basis...

We just released 0.20 and this should be resolved there.  Please try it out.

authors: CombeeMike crutkas


text:
Cannot find winver in run window

Environment
Windows build number: Microsoft Windows [Version 10.0.18363.836]
PowerToys version: v0.18.2
PowerToy module for which you are reporting the bug (if applicable): PowerToys Run

Steps to reproduce
Press Alt + space, type winver
Expected behavior
It should find this program
Actual behavior
It cannot find this program.
Screenshots

Please type > winver because it's a command.

Thank you!


text:
How to use one key to start Powertoys Run

📝 Provide a description of the new feature
I am using the Thinkpad Trackpoint Keyboard II, this keyboard enables user to custom fn keys to start app or webpages. when I use Powertoys Run, alt + space shortcuts often failed. So, is there any way to start only powertoys run using the custom function key?

If you'd like to see this feature implemented, add a 👍 reaction to this post.

are you running applications elevated such as Task manager or command prompt?

yes，Windows powershell or WSL

Yeah, we have an idea on how to fix it. Hopefully will get in .21, without a doubt .22
This is #6060

So the new version of PowerToys will integrate a centralized shortcuts manager and also allow users to custom their preferred key binding?
Also, will the newer PT allows user to map one key to key binding vice and versa (eg. 'Caps lock' map to 'alt + Shift' to switch input or 'Windows + hjkl' map to arrow keys)

authors: YucongDing crutkas


text:
[Localization] Image Resizer Sizes may appear unlocalized

Image Resizer has default Image Size names Small, Medium, Large and Phone, which are localized. However, since these Image Sizes are stored in the settings.json file, if the sizes already exist in the profile in one language, the same language will be retrieved irrespective of the current OS language.
For example in the scenario below a user has used Image Resizer for the first time while their OS language was English, and later they switch to French. Since the profile names have already saved the English names to JSON, opening Settings or Image Resizer in French will show the English names for the profile.

After deleting the settings file ImageResizer/settings.json, if the user opens Image Resizer directly from the context menu, the correct localized names will be loaded. If you open Settings first however, it will still load the English strings. This is because the default sizes in Settings are hardcoded strings.
Screenshot from French after deleting settings.json and opening Resize Pictures before Settings.

This to me is the bug
// quote
After deleting the settings file ImageResizer/settings.json, if the user opens Image Resizer directly from the context menu, the correct localized names will be loaded. If you open Settings first however, it will still load the English strings. This is because the default sizes in Settings are hardcoded strings.
The existing save file, i think is a fact of life not being localized

Yeah, I agree. I think it would be very hard to avoid the scenario I've mentioned above where user first used English json and then switched to French, but the sizes displayed are in English. The only way to avoid that would be if those 4 defaults were always present and read only.
To fix Settings loading only English, we need to move the hardcoded strings to resx so it gets localized here as well. The same strings are present in the ImageResizerUI project though, so it's a case of duplicated strings.

@crutkas @bricelam
We can make predefined sizes as readonly and localize corresponding labels. Also, it would be possible to delete predefined sizes. What do you think?
Should we add multilanguage support for user-defined sizes?

In previous versions with App.config, I believe I serialized sentinel values for the default names that would in turn look up resource the string and use that. This should still be possible using JSON.

@bricelam
Right now If we open the image resize from the context menu and settings.json does not exist localized sizes are written to settings.json(e.g. Small for English or Piccola for Spanish). Then even if the language interface is changed sizes will not change because they are hardcoded in settings.json. If the Image Resizer tab is opened from PT and settings.json does not exist it will write English sizes to settings.json regardless of interface language.
The suggested solution is to store keys and not localized strings to json file. It is easy to achieve. That solution is not consistent with the Image Resizer tab because it is possible to edit predefined size names. So we can make these names read-only. And of course, we can not localize custom sizes added by a user through settings. Is this solution acceptable?

authors: arjunbalgovind bricelam crutkas mykhailopylyp


text:
[Mouse Jump] - reduce winforms dependency, new thumbnail size settings, add shortcut keys - Ready For Review

Summary of the Pull Request
Makes a few improvements to Mouse Jump:

#25482
#25484
#24564
#25069

There's a summary below for each issue, and more details are available on each issue page...
1 - #25482 - reduce WinForms dependency
Added more Win32 API calls to remove the need for using the following built-in WinForms classes. This will make it easier to transition to a new presentation framework (WPF / WinUI3) at a later date if desired

System.Windows.Forms.Cursor
System.Windows.Forms.Screen
System.Windows.Forms.SystemInformation

This is the first 6 commits in this PR, down to (and including) d0489ae
2 - #25484 - improve popup responsiveness
If the form takes longer than 250ms to initialise it displays the preview with black rectangles and now renders screens incrementally one at a time to make it more responsive. (Behavior in 0.69.1 is to show the black rectangles but only refresh the thumbnail image once all remaining screenshots have been taken, so still feels a bit sluggish compared to this incremental approach)
https://user-images.githubusercontent.com/1193763/231855884-76146971-56e7-48ba-a915-21c2e1b58a18.mp4
3 - #24564 - customizable preview size
Added a Mouse Utils setting to specify the size of the preview image - default value is 1600 x 1200.

4 - #25069 - shortcuts for screen navigation
When the preview screen is visible the following keys will now move the cursor to the center of the appropriate screen.

Key
Action

Key 1-9  NumPad 1-9
Move to center of numbered screen

"P"
Move to center of primary screen  (not sure if this needs to be localizable?)

Left Arrow
Move to center of previous screen (wraps around screens 1..N)

Right Arrow
Move to center of next screen (wraps around screens 1..N)

Home
Move to center of first screen

End
Move to center of last screen

Screen numbers and sequence order for first / last / previous / next are per Display Settings
Future work:

Handle more than 9 screens?
When the preview image is visible, if a designated key is held down (e.g. ctrl), overlay screen numbers on the individual miniature screenshot images to help identify them (similar to the "Identify" button on the Display Settings dialog, but show the numbers on the preview image rather than as overlays on the actual screens themselves.

PR Checklist

[X] Closes:

#25482
#25484
#24564
#25069

[X] Communication: I've discussed this with @crutkas already. If work hasn't been agreed, this work might be rejected
[X] Tests: Added/updated and all pass
[X] Localization: All end user facing strings can be localized

"Thumbnail Size" settings strings all localised

[X] Dev docs: Added/updated

no changes

[X] New binaries: Added on the required places

no changes

[X] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

no changes

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

[X] Automated tests passing locally
[X] Minimal actions workflow (spelling check) passing for PR
[X] Full actions workflow (msbuild) passing for PR
[X] Manual regression-testing scenarios

[X] Happy path - clicking the thumbnail image works and cursor moves to the correct location
[X] Works on multiple monitors with different dpi scaling settings (e.g. 100% vs 150%)

https://github.com/microsoft/PowerToys/pull/23566#issuecomment-1411869418
https://github.com/microsoft/PowerToys/pull/23566#issuecomment-1412834413

[X] Handling negative coordinates on non-primary monitors if higher or "lefter" than primary monitor

https://github.com/microsoft/PowerToys/pull/23566#issuecomment-1404931694

[X] Mouse crosshair moves when Mouse Jump moves the cursor (mouse clicks and keyboard shortcuts)

#24523
#24527

@jaimecbernardo @htcfreek @crutkas - just a courtesy ping to let you know this PR is ready for review (assuming the build works!)

@niels9001
For me the content dialogue feels a bit odd here. Any ideas how we can get this into the settings action content?

The change suggested by @htcfreek can be part of another PR as well.

Fab, thanks.
I'll raise some issues for the "future work" suggestions once v70 has been released.

authors: htcfreek jaimecbernardo mikeclayton


text:
fix: Fix a couple of broken links

These changes should fix a couple of broken links on this page of website:
https://microsoft.github.io/SynapseML/docs/next/getting_started/installation/

/azp run

@elswork  thank you!!

Codecov Report

Merging #1266 (b465192) into master (1bbcb7b) will decrease coverage by 11.67%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master    #1266       +/-   ##
===========================================
- Coverage   83.13%   71.46%   -11.68%
===========================================
  Files         300      248       -52
  Lines       13699    11984     -1715
  Branches      660      660
===========================================
- Hits        11389     8564     -2825
- Misses       2310     3420     +1110

Impacted Files
Coverage Δ

...la/org/apache/spark/ml/param/TypedArrayParam.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...oft/azure/synapse/ml/codegen/GenerationUtils.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...m/microsoft/azure/synapse/ml/codegen/CodeGen.scala
0.00% <0.00%> (-98.44%)
:arrow_down:

...microsoft/azure/synapse/ml/codegen/Wrappable.scala
10.25% <0.00%> (-89.11%)
:arrow_down:

...soft/azure/synapse/ml/cognitive/AudioStreams.scala
0.00% <0.00%> (-87.88%)
:arrow_down:

...ft/azure/synapse/ml/cognitive/AzureSearchAPI.scala
2.59% <0.00%> (-87.02%)
:arrow_down:

...osoft/azure/synapse/ml/cognitive/AzureSearch.scala
7.19% <0.00%> (-80.58%)
:arrow_down:

...osoft/azure/synapse/ml/codegen/CodegenConfig.scala
3.70% <0.00%> (-77.78%)
:arrow_down:

...e/synapse/ml/cognitive/FormRecognizerSchemas.scala
7.69% <0.00%> (-76.93%)
:arrow_down:

...ala/org/apache/spark/ml/param/EstimatorParam.scala
12.50% <0.00%> (-75.00%)
:arrow_down:

... and 88 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1bbcb7b...b465192. Read the comment docs.

authors: codecov-commenter elswork mhamilton723

repo: microsoft/SynapseML


text:
docs: update anomaly detector docs

Related Issues/PRs

#xxx
What changes are proposed in this pull request?
Briefly describe the changes included in this Pull Request.
How is this patch tested?

[ ] I have written tests (not required for typo or doc fix) and confirmed the proposed feature/bug-fix/change works.

Does this PR change any dependencies?

[ ] No. You can skip this section.
[ ] Yes. Make sure the dependencies are resolved correctly, and list changes here.

Does this PR add a new feature? If so, have you added samples on website?

[ ] No. You can skip this section.
[ ] Yes. Make sure you have added samples following below steps.

Find the corresponding markdown file for your new feature in website/docs/documentation folder.
Make sure you choose the correct class estimators/transformers and namespace.
Follow the pattern in markdown file and add another section for your new API, including pyspark, scala (and .NET potentially) samples.
Make sure the DocTable points to correct API link.
Navigate to website folder, and run yarn run start to make sure the website renders correctly.
Don't forget to add <!--pytest-codeblocks:cont--> before each python code blocks to enable auto-tests for python samples.
Make sure the WebsiteSamplesTests job pass in the pipeline.

/azp run

Codecov Report

Merging #2103 (d4837db) into master (2f31f74) will decrease coverage by 59.61%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master    #2103       +/-   ##
===========================================
- Coverage   86.40%   26.80%   -59.61%
===========================================
  Files         311      311
  Lines       16267    16267
  Branches      818      818
===========================================
- Hits        14056     4360     -9696
- Misses       2211    11907     +9696

see 264 files with indirect coverage changes

/azp run

authors: JessicaXYWang codecov-commenter


text:
Add QuaRot (no quantization yet)

This PR adds the minimum required to apply QuaRot to a Llama-2 7b model to be act-and-weight quantizeable, without actually doing any quantization with rtn/gptq.

@jameshensman I pushed our fixes from last week (refactoring hadamard) which fixed the PR build, let me know what you think and if it's all good I'll merge into quarot main.

Approved.
On Wed, 1 May 2024 at 14:03, Maximilian Croci @.***>
wrote:

@jameshensman https://github.com/jameshensman I pushed our fixes from
last week (refactoring hadamard) which fixed the PR build, let me know what
you think and if it's all good I'll merge into quarot main.
—
Reply to this email directly, view it on GitHub
https://github.com/microsoft/TransformerCompression/pull/142#issuecomment-2088432846,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AABFWD3TC3NLJK4M5AGDGRTZADRZRAVCNFSM6AAAAABGY6PZXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYGQZTEOBUGY
.
You are receiving this because you were mentioned.Message ID:
@.***>

authors: jameshensman nailimixaM

repo: microsoft/TransformerCompression


text:
Unexpected behaviour of auto complete suggestion window.

Issue: Autocomplete suggestion window not popping on line 1 when I write something on line 2.
Autocomplete suggestion window is not working as expected. I have no custom settings on my typescript settings file. I tried replicating this behavior with all settings disabled but the problem persists. As, this is not a crash issue or installation issue, I am not sure what logs I can provide. Autocomplete suggestion works fine when typescript plugin is disabled or removed.

Sublime text version 4107. Forgot to put this in the post.

repo: microsoft/TypeScript-Sublime-Plugin


text:
fix typos and add new translations

Fixing some typos and add new Spanish translations.

@microsoft-github-policy-service agree


text:
Fix OddNumbersUnderTen to PositiveOddNumbersUnderTen

There are infinitely many OddNumbersUnderTen 😉

Heh, why not

authors: orta tjjfvi

repo: microsoft/TypeScript-Website


text:
Typescript-bot shouldnt reply to a PR it opened

Fixes https://github.com/microsoft/TypeScript/issues/42803

Agree!

authors: orta weswigham

repo: microsoft/TypeScript-repos-automation


text:
URLSearchParams constructor argument should be string | object

TypeScript Version:  2.2.1 / nightly (2.2.0-dev.201xxxxx)
Code
By the spec:
let params = new URLSearchParams({key: "730d67"})
params.toString() // "key=730d67"

Expected behavior:
The example should work.
Actual behavior:
Error: Argument of type '{ key: string }' is not assignable to parameter of type 'string | URLSearchParams`

PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes.

in the spec you linked:

[Constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = ""), Exposed=(Window,Worker)]

you're forgetting the sequence<sequence<USVString>> part
i think the type should be [string, string][] | {[key: string]: string} | string
that way these would work:
new URLSearchParams([
	["key", "value"]
]);

new URLSearchParams({
	key: "value"
});

and these wouldn't:
// no value
new URLSearchParams([
	["key"]
]);

// the value should be a string because it's converted to one
new URLSearchParams({
	key: 123
});

// ???
new URLSearchParams(URLSearchParams);

i am just a fan of getting things right

This issue has not been fixed in version 2.6

Can I overrule the constructor type oversight in my own d.ts file as a quick workaround?

This seems to be an issue still (or again)?
https://www.typescriptlang.org/play/#src=const url %3D new URLSearchParams({ foo%3A 1%2C bar%3A 2 })

It seems the playground is not up to date.

It understands conditional types, though. So it's at least 2.8, no?

Having the same issue with lib.dom.d.ts typings as of 2.9.2:
root@7ca164ff6a54:/usr/app# npm list typescript
admin-frontend@0.1.0 /usr/app
`-- typescript@2.9.2

[ts]
Argument of type '{ 'filter[accountId]': number; }' is not assignable to parameter of type 'string | URLSearchParams | undefined'.
  Object literal may only specify known properties, and ''filter[accountId]'' does not exist in type 'string | URLSearchParams | undefined'.

This seems to still be broken.
const params = new URLSearchParams({ "market": "USA" })
Results in a compilation failure:
(198,13): Argument of type '{ "market": string; }' is not assignable to parameter of type 'string | URLSearchParams | undefined'.
Object literal may only specify known properties, and '"market"' does not exist in type 'string | URLSearchParams | undefined'.

const params = new URLSearchParams([["market", "USA"]])
Also results in an error:
(197,44): Argument of type 'string[][]' is not assignable to parameter of type 'string | URLSearchParams | undefined'.
  Type 'string[][]' is not assignable to type 'URLSearchParams'.
    Property 'append' is missing in type 'string[][]'.

@NilsJPWerner What TS version are you using?

I updated my typescript and it fixed the issue!

It is still an issue in 3.6.2 😞

Reminder that typescript signature does not allow using a number as a value - only string values allowed.

Reminder that typescript signature does not allow using a number as a value - only string values allowed. Some people coming here may have this as the cause of the problem.

Exactly why I'm here 😄

authors: 0x80 NilsJPWerner codler epicgirl1998 kgtkr klesun lazarljubenovic mhegazy saschanaz tarekis tlmader

repo: microsoft/TypeScript


text:
Mixed !. and ?. should be warned

This is an anti-pattern on the current type system. And the compiler must not do quick fix so.

TypeScript Version:  3.7.x-dev.20191105

Search Terms:
Code
document.querySelector('_')!.textContent!.split('') // old code
document.querySelector('_')?.textContent!.split('') ?? 0 // string[]
document.querySelector('_')?.textContent?.split('') ?? 0 // string[] | 0

Expected behavior:
document.querySelector('_')!.textContent!.split('') // old code
document.querySelector('_')?.textContent!.split('') ?? 0 // unsafe, warning
document.querySelector('_')?.textContent?.split('') ?? 0 // safe

Actual behavior:
document.querySelector('_')!.textContent!.split('') // old code
document.querySelector('_')?.textContent!.split('') ?? 0 // unsafe, no warning
document.querySelector('_')?.textContent?.split('') ?? 0 // safe

Playground Link:
Related Issues:

If the compiler control details, the compiler would be possible to allow ?. after !..

Isn't this a just linting rule?  Whenever you use ! it is potentially unsafe.  The compiler never warns, an error is an error.

When quick fix observe this rule, it is wasteful splitting.

@falsandtru some discussion about what exactly is different between this and #35025 would be nice

This issue has meaning without adopting #35025 and meaningless if #35025 is adopted. So this issue and #35025 are in opposition. This is the definitive difference.

authors: RyanCavanaugh falsandtru kitsonk


text:
编译后可以迭代 class 里面的log方法

会不会打包成这样更好呢

Hi there, I'd recommend looking for a Chinese TypeScript community if this is about your code, or if you think this is a TypeScript bug please follow the issue template and re-create the issue in English


text:
[Proposal] Limit the compiler error about overriding the base class property with getter/setter accessors pair to the useDefineForClassFields : true case only

As suggested by @sandersn, opening a sibling issue to track the proposal from the https://github.com/microsoft/TypeScript/pull/37894
Topic
Currently, when a property in the base class is overridden with a getter/setter pair, compiler always generates an error:
Playground link
class BaseClass {
    prop        : string        = 'base_class'
}

class SubClass extends BaseClass {
    _prop       : string        = 'sub_class'

    /*
       ERROR: 'prop' is defined as a property in class 'BaseClass', but is overridden here in 'SubClass' as an accessor.
    */
    get prop () : string {
        return this._prop
    }
    set prop (value : string) {
        this._prop = value
    }
}
// try running this snippet with `useDefineForClassFields : true` and `useDefineForClassFields : false`
console.log((new SubClass).prop)

This error is motivated by the fact, that in modern JavaScript, class fields have DEFINE semantic and the above example won't work as intuitively expected if useDefineForClassFields compiler option is set to true.
The property access augmentation pattern
Need to note, that historically nobody was ever using the DEFINE semantic for class properties. Pretty much all the JavaScript and TypeScript code in the world currently assumes the SET semantic for class fields.
SET semantic makes it possible to use the property access augmentation pattern. Its main use case is to trigger some arbitrary code on property read/write. This is very useful for variety of purposes and is done by simply overriding the property of the base class with getter/setter accessors pair.
For example, lets say we have some 3rd party library with a class with parent property.
class ExternalClass {
    parent      : this      = undefined
    children    : this[]    = []

    appendChild (child : this) {
        child.parent    = this
   }
}

In the whole library, the parent is assumed to be a regular property and is accessed with dot notation.
Now lets say we want to plug this 3rd party library in our codebase, which has reactive capabilities. We need to track the access to the parent property and trigger some extra code on property write:
const reactive : any = undefined
type Reactive<V> = V

class OurClass extends ExternalClass {
   @reactive()
   reactiveParent     : Reactive<this>     = undefined

   private _parent : this
   get parent () : this {
       return this._parent
   }
   set parent (value : this) {
       this._parent = value
       this.reactiveParent = value
   }
}

With this simple subclass, we can use the 3rd party library code unchanged and mirror the writes to the parent property to the reactiveParent (which is plugged into the rendering process elsewhere).
DEFINE / SET semantic
TypeScript and JavaScript historically were using SET semantic for class fields. Pretty much all the code in the world assumes it. However, TC39 committee decided that class fields should use DEFINE semantic and to provide the way to migrate to new behavior, TypeScript introduced the new compiler config, useDefineForClassFields, disabled by default, because its a breaking change. Obviously, the "classic", historical behavior will need to be supported for a very long time.
With this option enabled, the "property access augmentation" pattern becomes invalid, as demonstrated by the example in the beginning (see however, the "Additional considerations" below). It is probably reasonable to generate a compiler error being discussed in this case.
With this option disabled, the pattern remains valid. In this case there are no reasons to limit the language expressiveness and restrict the user from using the pattern.
Proposal
Proposal is to generate the compiler error being discussed only for the "DEFINE" semantic (useDefineForClassFields : true) case.
Additional considerations
There's a promise from TC39 committee to provide an opt-in escape route to the "classic" SET semantic for class fields, using a decorator. This means, that the "property access augmentation" pattern will probably remain valid in JavaScript, even for native class fields, a user will just need to opt-in for it, using the decorator.
Ideally, compiler will need to be smart, to determine which semantic the field is actually using, to avoid the needless restrictions. Perhaps the nature of this error is that it should be handled better by the linter, rather than compiler.

Can you give examples of production libraries that use this pattern? One reason I was so confident in making it an error for all targets is that Microsoft, Google and Bloomberg checked their Typescript code with the error enabled and didn't run into any problems.
Another reason, while I agree that [[Set]] is more expressive, is that the future is unfortunately [[Define]]. My thinking is that if nobody's code is broken now, we should keep it that way by preventing new code from being written that will need modification later.

Obviously, the "classic", historical behavior will need to be supported for a very long time.

I've gotta say, it is very bad TC39 did that.
Anyway, the OP is correctly, when useDefineForClassFields is set to false, there should be no error, as that is how it always worked before.

There's a promise from TC39 committee to provide an opt-in escape route to the "classic" SET semantic for class fields, using a decorator. This means, that the "property access augmentation" pattern will probably remain valid in JavaScript, even for native class fields, a user will just need to opt-in for it, using the decorator.

Note that the decorator would need to be applied inside the base class, which means one would still need to modify the external library where they import the base class from unfortunately.

@sandersn We use this pattern in production at Bryntum. Sorry, can't provide a link to source code, since its proprietary.
The use case is that we have a "regular" codebase, which provides data structures, like tree, and we have a "reactive" codebase. The "regular" codebase is mature and stable, maintains backward compatibility, making changes in it is really not an option. However we need to combine both codebases and make them interoperable. The example I've posted is actually a real-world case, which solves the integration task with the "property access augmentation" pattern.
We also use this pattern extensively in our JavaScript codebase (which assumes ES5 and does not use native class fields).
I also use this pattern a lot in my open-source libraries (this is why I'm advocating for easing the error message), for example here.

One more example from my open-source project, testing tool called Siesta:
https://github.com/bryntum/siesta/blob/6dac32a6a2d0ce4dbab098b280f5ded87d930cf8/src/siesta/test/TestResult.tsx#L145
There's a base class AssertionBase, which contains a passed flag, indicating whether the assertion is passed or not. Also, there are special, asynchronous assertions, which consists from 2 parts - creation and resolution (which can be added after delay). For such async assertion, the passed flag is determined by the resolution - so it is natural to "wire" the reading of that flag to the resolution instance.
This pattern is very useful, for example, if I'd not use it in this "async assertion" case, I'd have to create a new method getPassed() and then replace all readings of .passed with that method call. As you can imagine this can be problematic, especially if you have some "external" code for which you need to keep the backward compatibility.

From a proprietary code base:
@InterfaceType() // nestjs decorators
export class NotificationBase extends TimeStamps {
  /**
   * Whether the notification should be hidden in the app or not
   * This is not an actual persisted field, it's overriden in subclasses instead
   */
  @Field()
  showInNotificationCenter?: boolean;
}

@ObjectType({ implements: NotificationBase })
export class TeamChatNotification extends NotificationBase {
  // @ts-expect-error: https://github.com/microsoft/TypeScript/issues/44927
  get showInNotificationCenter() {
    return this.unreadMessageCount > 0;
  }
}

This is a common pattern we use. Since a decorator can only work on a regular field, there's no other way to define this sort of behavior.

@andreialecu Shouldn't NotificationBase be abstract?

@sandersn that wouldn't work in this case, no. NotificationBase needs to be a concrete type because it is used to define "discriminators" for a mongodb schema, among other things.
Here's an example:
@Module({
  imports: [
    TypegooseModule.forFeature([
      {
        typegooseClass: NotificationBase, // Cannot assign an abstract constructor type to a non-abstract constructor type.ts(2322)
        discriminators: [...]

There are many other scenarios where things would break if it was made abstract:

However, I'm not sure what making it abstract would achieve.
The main reason for the pattern is to be able to define this in the base:
  @Field()
  showInNotificationCenter?: boolean;

Notice the decorator. It is used for a NestJS "code first" graphql schema definition.
Since you cannot apply decorators on a plain getter, this is the only way to make it work that I can think of. In practice it all works properly, it's just the TS error that needs to be ignored.

It seems like this'll cause compatability issues in the future? If a project with useDefineForClassFields: false extends a class from a library that was built with useDefineForClassFields: true, then the error message will not be shown but the error will occur at runtime. Silencing this error message in specific conditions will only cause confusion later on, unless TC39 decides to reverse their position.

The difference, as I see it, between this issue and generator/es5 is that useDefineForClassFields is not enabled by default so the additional safety of the error message becomes opt-in.

Hm.. Isn't it implicitly enabled when target is esnext, es2021? (I haven't checked, but I guess it should be)

I would be happier if this behavior were opt-out via a dedicated flag, rather than attaching more behavior to the useDefineForClassFields flag.

I believe useDefineForClassFields is exactly the flag that should control this error message. After all, the point is that concern about this compilation error is only valid for [[define]] semantic, and the useDefineForClassFields is what controls the semantic.

It sounds like, going forwards, programmers will want a way to declare class properties with [[set]] semantics.

Yes, definitely. And it seems the new decorators proposal address it with the new accessor keyword: https://github.com/tc39/proposal-decorators

What do you propose should happen, today (or more accurately, in the near future), when the target is set to e.g. es2021 with useDefineForClassFields=false and someone writes the following code:
class C {
    foo;
    bar = 1;
}

foo can be [[Set]] just by assigning it the constructor, but bar must be downleveled despite the es2021 target because otherwise it gets [[Define]]'d per ES.  Might cause some confusion: "Why is it not just using ES2021 syntax in the output JS?"

I'd suggest the following behavior:

target es2021/esnext + useDefineForClassFields not specified - all fields get [[Define]] semantic per ES spec, that is, implicit is [[Define]]
target es2021/esnext + useDefineForClassFields specified (either as true or false) - use the semantic according to the useDefineForClassFields, iow, preserve the user intention

In such setup, people who prefer [[Define]] semantic should either set the compilation target to es2021 or useDefineForClassFields=true. People who prefer [[Set]] semantic will be using useDefineForClassFields=false

One more example, I've stumbled upon today. I've implemented various primitives on the pure-data Segment class like (there's a lot more logic):
export class Segment {
    start           : number        = undefined
    end             : number        = undefined
    length          : number        = undefined

    contains (point : number) : boolean {
        return this.start <= point && point < this.end
    }
}

Now, I want to implement a "segment that represent a dimension of client rect of the DOM element" and be able to re-use the primitives from Segment. Naturally, start and end are bound to the getBoundClientRect results of the element:
export class ElementDimension extends Segment {
    el              : Element           = undefined
    type          : 'width' | 'height' = 'width'

    get start () : number {
        return this.type === 'width' ? this.el.getBoundingClientRect().left : this.el.getBoundingClientRect().top
    }

But TS compiler generates an unnecessary error, which is the scope of this proposal.

We'll take this up at a design meeting when we think that there's enough demand for it. However, right now it's two people's examples against a survey of many code bases across 3 large companies. If you can show quantitatively that demand is high, it would help.

Its two people examples only in this thread. Plus 12 positive emojis. Plus many more examples in the previous thread, which itself has 12 negative emojis.
https://github.com/microsoft/TypeScript/pull/37894#issuecomment-678646084 +3 emojis
https://github.com/microsoft/TypeScript/pull/37894#issuecomment-679190977 +12 emojis
https://github.com/microsoft/TypeScript/pull/37894#issuecomment-679279784 +3 emojis
https://github.com/microsoft/TypeScript/pull/37894#issuecomment-701947017 +13 emojis
https://github.com/microsoft/TypeScript/pull/37894#issuecomment-717789311 +5 emojis
https://github.com/microsoft/TypeScript/pull/37894#issuecomment-770318450 +1 emojis
https://github.com/microsoft/TypeScript/pull/37894#issuecomment-800857078
This means in total, 2 + 12 + 12 +7 + 3 + 12 + 3 + 13 + 5 + 1 = 70 people are positive for this feature. This amount of developers are representative enough.
Can you share what codebases were examined in the survey? Are they written in the OOP approach? Do the authors of those codebases have the JavaScript background, or they come from other languages?
Because in our internal JavaScript code base, the property access augmentation pattern is used excessively. It is a valid "classic" JavaScript pattern, which assumes [[Set]] semantic for properties.

@sandersn ^^^

@sandersn If I'll contribute a PR for this proposal - would it be merged?

@sandersn Ok, this is very sad to hear. It feels like the decision was made without the broad community discussion.

If we're being pedantic, this change singlehandedly prevents everyone from ever using public properties in any of their classes ever again, because it prevents others from ever extending their classes with new behaviour. When you're designing a class, it's impossible to know what someone else might wanna extend it with 10 years later. This change throws us back to the C++ hell of having useless public getters and setters for every attribute we'll ever make, just in case someone else might need to override the behaviour in the unforeseeable future.
Worst change ever made in the history of the TypeScript repository. Other languages are fighting to implement property overriding, while TypeScript decided to proactively prevent it.
@sandersn

authors: Mahi andreialecu canonic-epicure fatcerberus sandersn trusktr webstrand


text:
support "star projections" in generics

Suggestion

🔍 Search Terms
star projection

✅ Viability Checklist

My suggestion meets these guidelines:

[X] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[X] This wouldn't change the runtime behavior of existing JavaScript code
[X] This could be implemented without emitting different JS based on the types of the expressions
[X] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
[X] This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion
in kotlin, you can omit a generic from a type annotation when you don't care what its value is:
class Foo<T: Number>

fun foo(value: Foo<*>) {}

more info: https://typealias.com/guides/star-projections-and-how-they-work/
in typescript, to do the same thing you need to use any, which is gross:
type Foo<T extends number> = T

declare function foo(value: Foo<any>): void

or simply duplicate the bound, which isn't convenient:
type Foo<T extends number | string | boolean> = T

declare function foo(value: Foo<number | string | boolean>): void

📃 Motivating Example

it's especially useful for types that have multiple bounded generics
type ThingWithLotsOfGenerics<Type1 extends Base1, Type2 extends Base2, Type3 extends Base3> = {}

declare function foo(value: ThingWithLotsOfGenerics<*, *, *>): void

Another reason why something like this would be nice is that you can't always just replicate the bound. Especially if the type is invariant in its type  param, any is your only choice currently.

interface BlockModel {

}

interface Block<T extends BlockModel> {
    type : string
}

interface ParagraphModel extends BlockModel {

}

interface Paragraph extends Block<ParagraphModel> {

}

interface ListModel extends BlockModel {

}

interface List extends Block<ListModel> {

}

class DefaultParagraph implements Paragraph {
    type = "paragraph"
}

class DefaultList implements List {
    type = "list"
}

type BlockType<K extends BlockModel,T extends Block<K>> = T

type Blocks = {
    [K : string] : BlockType<*,*>
}

const blocks : Blocks = {
    "paragraph" : new DefaultParagraph(),
    "list" : new DefaultList()
}

Here's another example where this might be useful.
Consider following code:
interface Box<T> {
  getItem(): T;
}

interface BoxWrapper<T, B extends Box<T>> {
   getBox(): B
}

interface BoxWrapperFactory {
    create<T>(): BoxWrapper<T, Box<T>>;
}

class Something {
    ping() {}

    static fromBox(factory: BoxWrapperFactory) {
        factory.create<Something>().getBox().getItem().ping();
    }
}

We have to explicitly mention define Box either like it's done in code, at line create<T>(): BoxWrapper<T, Box<T>> or we can add default param to the BoxWrapper definition itself (that is, we can write interface BoxWrapper<T, B extends Box<T> = Box<T>> {
Both of constructions feels like slightly redundant. I can imagine that star syntax can help.

authors: DetachHead Schahen blutorange wakaztahir


text:
RegExp exec/match/split/etc return type should be (string | undefined)[], not string[]

/(a)|(b)/.exec('a') returns ['a', 'a', undefined]. The libs say string is the return array element type. But undefined is present if a reg exp group did not match.

https://github.com/microsoft/TypeScript/issues/17053#issuecomment-314154098

https://github.com/microsoft/TypeScript/issues/17053#issuecomment-314154098

Thanks @fatcerberus. Is there a way to opt out of this? It's been the root cause of two bugs in the project I'm working on and it really annoys the ESLint @typescript-eslint/no-unnecessary-condition because it believes it can't be undefined.

Thanks @fatcerberus. Is there a way to opt out of this? It's been the root cause of two bugs in the project I'm working on and it really annoys the ESLint @typescript-eslint/no-unnecessary-condition because it believes it can't be undefined.

Your only real option is to enable noUncheckedIndexedAccess which implicitly adds undefined to all array accesses, though that might prove to be an overly large hammer.

Your only real option is to enable noUncheckedIndexedAccess which implicitly adds undefined to all array accesses, though that might prove to be an overly large hammer.

Yer, that hammer is a bit too weighty for us. I think we'll make a collections of wrappers (e.g. exec = (pattern, string) => (string | undefined)[]) and get ESLint to error when not using the wrappers.

Yer, that hammer is a bit too weighty for us. I think we'll make a collections of wrappers (e.g. exec = (pattern, string) => (string | undefined)[]) and get ESLint to error when not using the wrappers.

authors: dj-foxxy fatcerberus


text:
Semicolon is added when organize import in specific case

Bug Report

🔎 Search Terms

Semicolon organize import
Semicolon vscode

🕗 Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about semicolon organize import

💻 Code

import { resolve } from "path"

type test = { var1: number; var2: string }

console.log(resolve(__dirname))

Vscode config (settings.json) :
{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.organizeImports": true
    // "source.sortImports": true // This also append when this is enabled
  },
  "typescript.tsdk": "./node_modules/typescript/lib"
}

Prettier config (.prettierrc)
{
  "semi": false
}

🙁 Actual behavior

When i save file, this add semicolon on all import.
🙂 Expected behavior

No add semicolon on import.
Additional information
That issue ONLY append when i have an type write like that { var1: number; var2: string }, so i think the organize/sort (maybe from here #31801) think the semicolon is used because is present in code.

TypeScript doesn't know about prettier and uses a heuristic to figure out it if seems like you're using semicolons or not. Since you could have used a comma to separate var1 and var2, this appears to be a "semicolon-friendly" codebase based on that heuristic.
Set the "Semicolons" formatter option according to your formatting style:

authors: RyanCavanaugh orblazer


text:
Add option to throw error when ! (NonNull expression) is used on a non-nullish expression

🔍 Search Terms
"cast", "non null", "nonnull", "@ts-expect-error", "strict", "error"
✅ Viability Checklist

[X] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[X] This wouldn't change the runtime behavior of existing JavaScript code
[X] This could be implemented without emitting different JS based on the types of the expressions
[X] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
[X] This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
[X] This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals

⭐ Suggestion
Add in the TSConfig.json a way to tell TS to check when devs are using ! (non null expressions) on variables that are non null
📃 Motivating Example
Mimic @ts-ignore vs @ts-expect-error but for !:
In well maintained codebases, @ts-expect-error can be preferred to @ts-ignore to get rid of those as soon as they become non necessary.
A similar thinking could be applied to ! so that we can keep healthy codebases
💻 Use Cases

What do you want to use this for?

Seeing ! in a codebase should mean that the variable can be nullish, and that we're telling TS that it isn't in practice.
It replicates @ts-expect-error but for !, at one difference: when using @ts-expect-error you can pick if you want this or @ts-ignore. With this proposal, it'd be set in the TSConfig so would get applied to all ! (but this is I think what devs would want)

What shortcomings exist with current approaches?

In large codebases, we can't keep track of why a ! was used, and whether it's still required. So we need to come back to them, and remove them manually to see if TS is happy or not without them. We can use ESLint to warn us against the use of ! but it's a 100% process.

What workarounds are you using in the meantime?

TypeScript-ESLint can be used to either warn / ban ! and instead push devs to use ?. or ??, but sometimes a variable is indeed never nullish, so it modifies / slows down the runtime for no real reason.
As TypeScript-ESLint can also have access to the full TS process, we could also use it to check the type of the variable on which ! is used to see if it's necessary. But this requires spawning the full TS process in ESLint, slowing it down significantly on large codebases (which is why having it directly in TS could be better)

I know that there is already https://github.com/microsoft/TypeScript/issues/46268 that exists, but this other issue also mentions modifying ?? & ?., and here I'm just talking about !

This is https://typescript-eslint.io/rules/no-unnecessary-type-assertion. Re: performance, it largely depends on how your project is set up,

I often see ESLint reporting this assertion due to having stale types, and I have to restart the ESLint server to fix it. For that reason alone I'd like to see this included in TypeScript itself.

authors: Ayc0 Josh-Cena xixixao


text:
Fix #33483 - Narrow unknown under inequality when assumed false

Fixes #33483

LGTM but I'm curious
@typescript-bot test this
@typescript-bot user test this

User baseline diffs are noise

Thanks @RyanCavanaugh !

authors: RyanCavanaugh jack-williams


text:
fix(52270): update optionalReplacementSpan in continuePreviousIncompleteResponse

Fixes #52270

I don’t think there’s a way to write a test for this besides asserting the optionalReplacementSpan you expect in a unit test in src/testRunner/unittests/tsserver/completionsIncomplete.ts. The fourslash tests aren’t set up to do continuations IIRC.

I tried to add a regression test, here are the test results before this change

@microsoft-github-policy-service agree

authors: andrewbranch jadestrong


text:
Optimize union type creation

This PR implements two optimizations to our union type creation logic:

When resolving the type Record<A, B>[A], where A and B are large union types, we end up creating a union type from a list of types B, B, ..., B, where B is repeated as many times as the size of A. The union type creation logic collects the constituent type list by "flattening" each B, which ends up generating a lot of useless work. We now detect that we've already processed B and ignore all but the first occurrence.
We now cache the results of unioning a pair of types, where one or both are union types, by a key constructed from the two type identities. Previously, we'd first flatten all of the (non-union) types into a combined set, which is a lot more work for large unions. This in particular helps for repeated creations of U | undefined where U is some large union type.

The check time for the example in #53761 effectively drops to zero with these optimizations.
Fixes #53761.

@typescript-bot test this
@typescript-bot user test this inline
@typescript-bot run dt
@typescript-bot perf test faster
@typescript-bot test top100

@typescript-bot perf test this faster

authors: ahejlsberg jakebailey


text:
Revert PR 56087

This reverts #56087.
Fixes #57843
Fixes #57781
Fixes #57357
Reopens #49171
Not sure if I'm reading the baselines correctly, but since this is removing the perf baseline, I guess the new baselines would have caught this regression as before the revert, there are some 3.2k types, but after, it's under the 100 type threshold? And similarly for symbols.

FWIW this will likely not cherry-pick without manual intervention because of the baseline change.

Sent #57850 for 5.4.


text:
Error on Apche2 service start

Windows Build Number
10.0.19042 Build 19042
WSL Version

[X] WSL 2
[ ] WSL 1

Kernel Version
No response
Distro Version
ubuntu 18.04 LTS
Other Software

Starting Apache httpd web server apache2                          [Sat Aug 28 13:55:57.704119 2021] [core:warn] [pid 209:tid 140156452080576] (92)Protocol not available: AH00076: Failed to enable APR_TCP_DEFER_ACCEPT

Repro Steps
just hit
sudo service apache2 start

Starting Apache httpd web server apache2                          [Sat Aug 28 13:55:57.704119 2021] [core:warn] [pid 209:tid 140156452080576] (92)Protocol not available: AH00076: Failed to enable APR_TCP_DEFER_ACCEPT

Expected Behavior
there should be no error .

Starting Apache httpd web server apache2                          [Sat Aug 28 13:55:57.704119 2021] [core:warn] [pid 209:tid 140156452080576] (92)Protocol not available: AH00076: Failed to enable APR_TCP_DEFER_ACCEPT

Actual Behavior
its giving out the error:

Starting Apache httpd web server apache2                          [Sat Aug 28 13:55:57.704119 2021] [core:warn] [pid 209:tid 140156452080576] (92)Protocol not available: AH00076: Failed to enable APR_TCP_DEFER_ACCEPT

Diagnostic Logs
No response

Thanks for reporting the issue!  I did a quick search online for the error code above and found a number of references for resolving the issue by adding a file to the Linux filesystem (i.e. http://www.codza.com/blog/lamp-in-wsl-win10#:~:text=You can now start the apache server%3A You,should look like this%3A Install mysql by running%3A)
I do not think this is specific to WSL but please let me know if I misread the original issue.

That url is not working anymore.
Please don't add only a link for future reference.

Thanks for reporting the issue! I did a quick search online for the error code above and found a number of references for resolving the issue by adding a file to the Linux filesystem (i.e. http://www.codza.com/blog/lamp-in-wsl-win10#:~:text=You can now start the apache server%3A You,should look like this%3A Install mysql by running%3A)
I do not think this is specific to WSL but please let me know if I misread the original issue.

This did the trick for me:

Add the following line to the end of the /etc/apache2/apache2.conf file:
AcceptFilter http none

Source:

https://github.com/microsoft/WSL/issues/1953#issuecomment-295370994

authors: Aldo-f shubhamcloud9 stehufntdev

repo: microsoft/WSL


text:
WinAppDriver recorder cut end of automation ID

Hi
I'm using FindByAccecibilityID to find elements to click on.
I record the clicks by the recorder and take automationID from the recorded XPath
but the recorder cuts the end of the automationID so I don't get the full name of automation ID
Any ideas how to solve it?
Thank you

Use inpect and build your xpath.

Thank you
I'm familiar with the option of inspect but I would like to provide recorder to the users...any idea for that?

repo: microsoft/WinAppDriver