diff --git a/smac/facade/func_facade.py b/smac/facade/func_facade.py
index c747fd01b..5a5aefc74 100644
--- a/smac/facade/func_facade.py
+++ b/smac/facade/func_facade.py
@@ -52,8 +52,12 @@ def fmin_smac(func: callable,
     """
     # create configuration space
     cs = ConfigurationSpace()
+
+    # Adjust zero padding
+    tmplt = 'x{0:0' + str(len(str(len(bounds)))) + 'd}'
+
     for idx, (lower_bound, upper_bound) in enumerate(bounds):
-        parameter = UniformFloatHyperparameter(name="x%d" % (idx + 1),
+        parameter = UniformFloatHyperparameter(name=tmplt.format(idx + 1),
                                                lower=lower_bound,
                                                upper=upper_bound,
                                                default_value=x0[idx])
@@ -77,11 +81,10 @@ def fmin_smac(func: callable,
     smac = SMAC(scenario=scenario, tae_runner=ta, rng=rng)
     smac.logger = logging.getLogger(smac.__module__ + "." + smac.__class__.__name__)
     incumbent = smac.optimize()
-
     config_id = smac.solver.runhistory.config_ids[incumbent]
     run_key = RunKey(config_id, None, 0)
     incumbent_performance = smac.solver.runhistory.data[run_key]
-    incumbent = np.array([incumbent['x%d' % (idx + 1)]
+    incumbent = np.array([incumbent[tmplt.format(idx + 1)]
                           for idx in range(len(bounds))], dtype=np.float)
     return incumbent, incumbent_performance.cost, \
            smac

Wrong parameters order
Hi all, 

we have realized that when using fmin_smac, the input parameters given to the function are processed in the wrong order if their count is higher than 9. 

For instance when executing this command: 

x, cost, _ = fmin_smac(func=to_minimize,
                       x0=[0.5, 20, 0.7, 0.15, 10, 0.5, 1.0, 0.1, 0.25, 1.0, 0.5],
                       bounds=[(0, 1), (5, 25), (0.1, 2.0), (0.0, 1.5), (2, 20), (0, 1), (1, 1.3), (0.001, 1), (0.001, 2), (0.05, 9), (0.2, 0.8)],
                       maxfun=2000,
                       rng=3)

the input parameters are swapped in the following way, as reported in the configspace.pcs file:

x1 real [0.0, 1.0] [0.5]
x10 real [0.05, 9.0] [1.0]
x11 real [0.2, 0.8] [0.5]
x2 real [5.0, 25.0] [20.0]
x3 real [0.1, 2.0] [0.7]
x4 real [0.0, 1.5] [0.15]
x5 real [2.0, 20.0] [10.0]
x6 real [0.0, 1.0] [0.5]
x7 real [1.0, 1.3] [1.0]
x8 real [0.001, 1.0] [0.1]
x9 real [0.001, 2.0] [0.25]


Any idea what's happening there? Thanks for your help!

Best, 

L.

diff --git a/test/test_facade/test_func_facade.py b/test/test_facade/test_func_facade.py
index 11ab7c88d..43748ed1c 100644
--- a/test/test_facade/test_func_facade.py
+++ b/test/test_facade/test_func_facade.py
@@ -33,3 +33,20 @@ class TestSMACFacade(unittest.TestCase):
         self.assertEqual(type(f), type(f_s))
 
         self.output_dirs.append(smac.scenario.output_dir)
+
+    def test_parameter_order(self):
+        def func(x):
+            for i in range(len(x)):
+                self.assertLess(i - 1, x[i])
+                self.assertGreater(i, x[i])
+            return 1
+
+        default = [i - 0.5 for i in range(10)]
+        bounds = [(i - 1, i) for i in range(10)]
+        print(default, bounds)
+        _, _, smac = fmin_smac(func=func, x0=default,
+                               bounds=bounds,
+                               maxfun=1)
+
+        self.output_dirs.append(smac.scenario.output_dir)
+

pip install -e .
parse_log_pytest
requirements.txt
nose pytest
apt-get update apt-get install -y build-essential swig
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
ConfigSpace==0.4.19
Cython==3.0.12
docutils==0.18.1
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
Jinja2==3.0.3
joblib==1.1.1
MarkupSafe==2.0.1
nose==1.3.7
numpy==1.19.5
packaging==21.3
pluggy==1.0.0
psutil==7.0.0
py==1.11.0
Pygments==2.14.0
pynisher==0.6.4
pyparsing==3.1.4
pyrfr==0.8.2
pytest==7.0.1
pytz==2025.2
requests==2.27.1
scikit-learn==0.24.2
scipy==1.5.4
six==1.17.0
-e git+https://github.com/automl/SMAC3.git@dc8ebc9763d15516d4f96c32e75c431783487845#egg=smac
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-rtd-theme==2.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
threadpoolctl==3.1.0
tomli==1.2.3
typing==3.7.4.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: SMAC3
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - configspace==0.4.19
      - cython==3.0.12
      - docutils==0.18.1
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - joblib==1.1.1
      - markupsafe==2.0.1
      - nose==1.3.7
      - numpy==1.19.5
      - packaging==21.3
      - pluggy==1.0.0
      - psutil==7.0.0
      - py==1.11.0
      - pygments==2.14.0
      - pynisher==0.6.4
      - pyparsing==3.1.4
      - pyrfr==0.8.2
      - pytest==7.0.1
      - pytz==2025.2
      - requests==2.27.1
      - scikit-learn==0.24.2
      - scipy==1.5.4
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-rtd-theme==2.0.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - threadpoolctl==3.1.0
      - tomli==1.2.3
      - typing==3.7.4.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/SMAC3

test/test_facade/test_func_facade.py::TestSMACFacade::test_parameter_order
test/test_facade/test_func_facade.py::TestSMACFacade::test_func_smac
smac/facade/func_facade.py
smac/facade/func_facade.py